Jump to content

Is this a good way to make a shop skript?


853620298491042_
 Share

Recommended Posts

Hello, I recently started making a shop skript, and I wanted to ask if this is a good way creating the shop skript? Can I make it more compact or something? (Its fully working, but its kinda long.."

...
	wait 1 tick
	open virtual chest inventory with size 6 named "&3Slabs &7& &3Stairs" to player
	wait 1 tick
	format gui slot 0 of player with 16 oak slabs named "&c16 Oak slabs" with lore " " and "&a25$" and " " to run:
		if {bal::%player's uuid%} < 25:
			send "{@prefix} &cNot enough &a$$$&c!"
		else if {bal::%player's uuid%} >= 25:
			remove 25 from {bal::%player's uuid%}
			give player 16 oak slabs
			send "{@prefix} &bBought &c16 oak slabs&b. Current balance: &c%{bal::%player's uuid%}%&b$"

 

Link to comment
Share on other sites

You can use functions to make it more compact. Here is a tutorial that you can look at to see how functions work.

https://skripthub.net/tutorials/9

Discord - Tarna256#8675

In-game name - _Tarna_

Follow @Tarna_256 on Twitter

---------------------------------------------------------

[VIP] - 7/27/2020

Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share



×
×
  • Create New...