Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- p: &a&lShop &7» # Prefix
- ShopTitle: &a&lShop # Shop gui title
- menu-category-name: &f» &a&l{category} &f« # Placeholders: {category} = category name
- menu-category-lore: &eClick to open &f{category} &ecategory. # Placeholders: {category} = category name
- menu-item-lore: ||&7» &aPrice: &f{price}||&7» &aClick to buy # This is an extra lore to items in shop - Placeholders: {price} = category name, || = newline in lore
- menu-soon-item: barrier
- menu-soon-name: &7» &cSoon &7«
- menu-back-item: arrow
- menu-back-name: &7« &eBack
- # Close shop menu after a purchase?
- close-after-buy: false
- #
- #! CODE - DON'T EDIT UNLESS YOU KNOW WHAT YOU'RE DOING.
- #
- on load:
- if {Shop::shop-background::item} is not set:
- set {Shop::shop-background::item} to gray stained glass pane
- if {Shop::shop-size} is not set:
- set {Shop::shop-size} to 5
- function shopBuy(p: player, slot: integer, cat: text = "false"):
- set {_pU} to uuid of {_p}
- if {_cat} is "false":
- if {_p}'s balance >= {Shop::shop::%{_slot}%::price}:
- remove {Shop::shop::%{_slot}%::price} from {_p}'s balance
- if {Shop::shop::%{_slot}%::cmds::*} is set:
- loop {Shop::shop::%{_slot}%::cmds::*}:
- set {_cmd} to loop-value
- replace all "[p]" with "%{_p}%" in {_cmd}
- if first 3 characters of loop-value is "[c]":
- set {_cmd} to subtext of {_cmd} from character 4 to (length of {_cmd})
- execute console command "%{_cmd}%"
- else:
- execute {_p} command "%loop-value%"
- send "{@p} &aYou've bought &8(&a%name of slot {_slot} of {_p}'s current inventory%&8) &afor &f%{Shop::shop::%{_slot}%::price}% &ashop." to {_p}
- if {@close-after-buy} is true:
- close {_p}'s inventory
- stop
- else:
- give {_p} (slot {_slot} of {_p}'s current inventory) lored ""
- send "{@p} &aYou've bought &8(&a%name of slot {_slot} of {_p}'s current inventory%&8) &afor &f%{Shop::shop::%{_slot}%::price}% &ashop." to {_p}
- #send "{@p} &cThis item has no commands to execute." to {_p}
- stop
- else:
- send "{@p} &cYou don't have enough money to buy that." to {_p}
- stop
- else:
- if {_p}'s balance >= {Shop::shop::%{_cat}%::items::%{_slot}%::price}:
- remove {Shop::shop::%{_cat}%::items::%{_slot}%::price} from {_p}'s balance
- if {Shop::shop::%{_cat}%::items::%{_slot}%::cmds::*} is set:
- loop {Shop::shop::%{_cat}%::items::%{_slot}%::cmds::*}:
- set {_cmd} to loop-value
- replace all "[p]" with "%{_p}%" in {_cmd}
- if first 3 characters of loop-value is "[c]":
- set {_cmd} to subtext of {_cmd} from character 4 to (length of {_cmd})
- execute console command "%{_cmd}%"
- else:
- execute {_p} command "%loop-value%"
- send "{@p} &aYou've bought &8(&a%name of slot {_slot} of {_p}'s current inventory%&8) &afor &f%{Shop::shop::%{_cat}%::items::%{_slot}%::price}% &ashop." to {_p}
- if {@close-after-buy} is true:
- close {_p}'s inventory
- else:
- give {_p} (slot {_slot} of {_p}'s current inventory) lored ""
- send "{@p} &aYou've bought &8(&a%name of slot {_slot} of {_p}'s current inventory%&8) &afor &f%{Shop::shop::%{_cat}%::items::%{_slot}%::price}% &ashop." to {_p}
- #send "{@p} &cThis item has no commands to execute." to {_p}
- stop
- else:
- send "{@p} &cYou don't have enough shop to buy that." to {_p}
- stop
- function shopOpen(p: player, cat: text):
- set {_pU} to uuid of {_p}
- if {_cat} = "main":
- open virtual chest with {Shop::shop-size} rows named "{@ShopTitle}" to {_p}
- wait 3 ticks
- loop {Shop::shop::*}:
- set {_lv} to loop-value
- if {Shop::shop::%{_lv}%::price} is set:
- if {Shop::shop::%{_lv}%::price} = 0:
- format gui slot {_lv} of {_p} with {Shop::shop::%{_lv}%::item} to run:
- {Shop::shop::%{_lv}%::cmds::*} is set
- loop {Shop::shop::%{_lv}%::cmds::*}:
- set {_cmd} to loop-value-2
- replace all "[p]" with "%{_p}%" in {_cmd}
- if first 3 characters of loop-value-2 is "[c]":
- set {_cmd} to subtext of {_cmd} from character 4 to (length of {_cmd})
- execute console command "%{_cmd}%"
- else:
- execute {_p} command "%loop-value-2%"
- else:
- set {_lore} to "{@menu-item-lore}"
- replace all "{price}" with "%{Shop::shop::%{_lv}%::price}%" in {_lore}
- if lore of {Shop::shop::%{_lv}%::item} is not "":
- set {_lore} to "%lore of {Shop::shop::%{_lv}%::item}%%{_lore}%"
- format gui slot {_lv} of {_p} with {Shop::shop::%loop-value%::item} lored "%colored {_lore}%" to run:
- shopBuy({_p}, {_lv}, "false")
- else:
- set {_name} to "{@menu-category-name}"
- set {_lore} to "{@menu-category-lore}"
- replace all "{category}" with "%{_lv}%" in {_name}
- replace all "{category}" with "%{_lv}%" in {_lore}
- if lore of {Shop::shop::%{_lv}%::item} is set:
- format gui slot {Shop::shop::%{_lv}%::slot} of {_p} with {Shop::shop::%{_lv}%::item} named "%{_name}%" lored "%colored lore of {Shop::shop::%{_lv}%::item}%||%{_lore}%" to run:
- shopOpen({_p}, {_lv})
- else:
- format gui slot {Shop::shop::%{_lv}%::slot} of {_p} with {Shop::shop::%{_lv}%::item} named "%{_name}%" lored "%{_lore}%" to run:
- shopOpen({_p}, {_lv})
- loop 54 times:
- if slot loop-number - 1 of {_p}'s current inventory is air:
- format gui slot (loop-number - 1) of {_p} with {Shop::shop-background::item} named ""
- else:
- if "%{Shop::shop::%{_cat}%::items::*}%" is not "<none>":
- set {_name} to "{@menu-category-name}"
- replace all "{category}" with "%{_cat}%" in {_name}
- if {Shop::shop::%{_cat}%::size} is set:
- set {_size} to {Shop::shop::%{_cat}%::size}
- else:
- set {_size} to 6
- open virtual chest with {_size} rows named "%{_name}%" to {_p}
- wait a tick
- loop {Shop::shop::%{_cat}%::items::*}:
- set {_lv} to loop-value
- if {Shop::shop::%{_cat}%::items::%{_lv}%::price} = 0:
- format gui slot {_lv} of {_p} with {Shop::shop::%{_cat}%::items::%{_lv}%::item} to run:
- {Shop::shop::%{_lv}%::cmds::*} is set
- loop {Shop::shop::%{_lv}%::cmds::*}:
- set {_cmd} to loop-value-2
- replace all "[p]" with "%{_p}%" in {_cmd}
- if first 3 characters of loop-value-2 is "[c]":
- set {_cmd} to subtext of {_cmd} from character 4 to (length of {_cmd})
- execute console command "%{_cmd}%"
- else:
- execute {_p} command "%loop-value-2%"
- else:
- set {_lore} to "{@menu-item-lore}"
- replace all "{price}" with "%{Shop::shop::%{_cat}%::items::%{_lv}%::price}%" in {_lore}
- if lore of {Shop::shop::%{_cat}%::items::%{_lv}%::item} is set:
- set {_lore} to "%lore of {Shop::shop::%{_cat}%::items::%{_lv}%::item}%%{_lore}%"
- format gui slot {_lv} of {_p} with {Shop::shop::%{_cat}%::items::%{_lv}%::item} lored "%colored {_lore}%" to run:
- shopBuy({_p}, {_lv}, {_cat})
- loop 54 times:
- if slot loop-number - 1 of {_p}'s current inventory is air:
- format gui slot (loop-number - 1) of {_p} with {Shop::shop-background::item} named ""
- if slot loop-number of {_p}'s current inventory is not set:
- format gui slot (loop-number - 1) of {_p} with {@menu-back-item} named "{@menu-back-name}" to run:
- shopOpen({_p}, "main")
- else:
- send "{@p} &cThis category has no items." to {_p}
- command /shop [<text=open>] [<text>] [<text>] [<text>]:
- trigger:
- if arg-1 is "help" or "h":
- send ""
- send " &a&lShop &7- &a&lHelp"
- send ""
- send " &a/shop help &7&oShows this message."
- send " &a/shop open(o) &7&oOpen shop shop."
- send " &a/shop balance(bal) &7&oShows balance of you/others."
- if sender has permission "shop.help":
- send " &e/shop addcategory(ac) <id(name)> <slot> <size 1-6> &7&oAdd a category to shop shop."
- send " &e/shop removecategory(rc) <id(name)> <slot> &7&oRemove a category from shop shop."
- send " &e/shop additem(ai) <category/main> <slot> <cost(number)> &7&oAdd an item to shop shop."
- send " &e/shop copyitem(ci) <category/main> <from slot> <to slot> &7&oCopy a slot to another in a category."
- send " &e/shop removeitem(ri) <category/main> <slot> <cost(number)> &7&oRemove an item from shop shop."
- send " &e/shop addcmd(acmd) <category/main> <slot> <command without /> &7&oAdd a command to a slot in shop shop."
- send " &e/shop removecmd(rcmd) <category/main> <slot> <command without /> &7&oAdd a command to a slot in shop shop. (You can use &c* &7&oto remove all commands)"
- send " &e/shop setprice <category/main> <slot> <cost(number)> &7&oSet the price of a slot."
- send " &e/shop setitem <category/main> <slot> &7&oSet the item of a slot."
- send " &e/shop cmds <category/main> <slot> &7&oShows commands of slot in shop shop (you can also remove them with 1 click here)"
- send " &e/shop give <player> <number> &7&oAdd a number of shop to a player."
- send " &e/shop take <player> <number> &7&oRemove a number of shop from a player."
- send " &e/shop set <player> <number> &7&oSet a player's shop to a number of shop."
- send " &e/shop size <category/main> <integer 1-6> &7&oSet shop shop menu size."
- send " &e/shop background(bg) &7&oSet shop shop background items to your held item."
- send ""
- json("%player%", "&f» &c&lNOTES &f«||ttp:&f&l##1 &aThe main shop shop menu is called &f'main'%nl% &aand you can't add a category with that name%nl%&f&l##2 &aYou can add a decoration &aitem(s) such as 'Soon' to any category%nl% &aby setting the price to 0 when adding the item%nl% &athis will make the item not clickable.")
- send ""
- stop
- if arg-1 is "open" or "o":
- #if sender doesn't have permission "shop.shop":
- #send "{@p} &cYou don't have enough permissions to do that."
- #stop
- if {Shop::shop::*} is set:
- if {Shop::shop::*} is "":
- send "{@p} &cCurrently there are no items in shop."
- stop
- send "{@p} &aOpenning shop.."
- close player's inventory
- wait 2 ticks
- shopOpen(player, "main")
- stop
- else:
- send "{@p} &cCurrently there are no items in shop."
- stop
- if arg-1 is "addcategory" or "ac":
- if sender doesn't have permission "shop.addcategory":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop addcategory &f<name> &c<slot(integer)> <size 1-6>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop addcategory <name> &f<slot(integer)> &c<size 1-6>"
- stop
- if arg-4 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop addcategory <name> <slot(integer)> &f<size 1-6>"
- stop
- if player's tool is air:
- send "{@p} &cYou must hold an item to do that."
- stop
- #if name of player's tool is not set:
- #send "{@p} &cYour item must have a name to do that."
- #stop
- if arg-2 is "main":
- send "{@p} &cThis is the main category and you can't use it."
- stop
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- send "{@p} &cCategory &f%arg-2% &calready exists."
- stop
- add arg-2 to {Shop::shop::*}
- set {Shop::shop::%arg-2%::item} to player's tool
- set {Shop::shop::%arg-2%::slot} to arg-3 parsed as integer
- set {Shop::shop::%arg-2%::size} to arg-4 parsed as integer
- send "{@p} &aAdded &f%arg-2% &acategory to Shop."
- stop
- if arg-1 is "removecategory" or "rc":
- if sender doesn't have permission "shop.removecategory":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop removecategory &f<name>"
- stop
- if arg-2 is "main":
- send "{@p} &cThis is the main category and you can't remove it."
- stop
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &f%arg-2% &ccategory doesn't exist."
- stop
- delete {Shop::shop::%arg-2%::item}
- delete {Shop::shop::%arg-2%::slot}
- loop {Shop::shop::%arg-2%::items::*}:
- remove loop-value from {Shop::shop::%arg-2%::items::*}
- delete {Shop::shop::%arg-2%::items::*}
- remove arg-2 from {Shop::shop::*}
- send "{@p} &aRemoved &f%arg-2% &acategory from Shop."
- stop
- if arg-1 is "additem" or "ai":
- if sender doesn't have permission "shop.additem":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop additem &f<category> &c<slot(integer)> <cost(number)>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop additem <category> &f<slot(integer)> &c<cost(number)>"
- stop
- if arg-4 parsed as number is not set:
- send "{@p} &7Usage: &c/shop additem <category> <slot(integer)> &f<cost(number)>"
- stop
- if player's tool is air:
- send "{@p} &cYou must hold an item to do that."
- stop
- if name of player's tool is not set:
- send "{@p} &cYour item must have a name to do that."
- stop
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_exists1} to true
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- if arg-2 is "main":
- set {_id} to arg-3 parsed as integer
- add {_id} to {Shop::shop::*}
- set {Shop::shop::%{_id}%::item} to player's tool
- set {Shop::shop::%{_id}%::price} to arg-4 parsed as number
- send "{@p} &aSlot &f%arg-3% &ahas been set to your item with cost &f%arg-4% &ashop in category &f%arg-2%&a."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- add {_id} to {Shop::shop::%arg-2%::items::*}
- set {Shop::shop::%arg-2%::items::%{_id}%::item} to player's tool
- set {Shop::shop::%arg-2%::items::%{_id}%::price} to arg-4 parsed as number
- send "{@p} &aSlot &f%arg-3% &ahas been set to your item with cost &f%arg-4% &ashop in category &f%arg-2%&a."
- stop
- if arg-1 is "copyitem" or "ci":
- if sender doesn't have permission "shop.copyitem":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop copyitem &f<category> &c<from slot> <to slot>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop copyitem <category> &f<from slot> &c<to slot>"
- stop
- if arg-4 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop copyitem <category> <from slot> &f<to slot>"
- stop
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_catExists} to true
- if {_catExists} is not set:
- send "{@p} &f%arg-2% &ccategorty doesn't exist."
- stop
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = arg-3 parsed as integer:
- set {_oldExists} to true
- if loop-value = arg-4 parsed as integer:
- set {_newExists} to true
- if {_oldExists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- if {_newExists} is true:
- send "{@p} &cSlot &f%arg-4% &calready exists."
- stop
- else:
- loop {Shop::shop::*}:
- if loop-value = arg-3 parsed as integer:
- set {_oldExists} to true
- if loop-value = arg-4 parsed as integer:
- set {_newExists} to true
- if {_oldExists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- if {_newExists} is true:
- send "{@p} &cSlot &f%arg-4% &calready exists."
- stop
- if arg-2 is "main":
- set {_oldID} to arg-3 parsed as integer
- set {_newID} to arg-4 parsed as integer
- add {_newID} to {Shop::shop::*}
- set {Shop::shop::%{_newID}%::item} to {Shop::shop::%{_oldID}%::item}
- set {Shop::shop::%{_newID}%::price} to {Shop::shop::%{_oldID}%::price}
- set {Shop::shop::%{_newID}%::cmds::*} to {Shop::shop::%{_oldID}%::cmds::*}
- send "{@p} &aSlot &f%arg-3% &ahas been copied to slot &f%arg-4% &ain &f%arg-2% &acategory."
- stop
- else:
- set {_oldID} to arg-3 parsed as integer
- set {_newID} to arg-4 parsed as integer
- add {_newID} to {Shop::shop::%arg-2%::items::*}
- set {Shop::shop::%arg-2%::items::%{_newID}%::item} to {Shop::shop::%arg-2%::items::%{_oldID}%::item}
- set {Shop::shop::%arg-2%::items::%{_newID}%::price} to {Shop::shop::%arg-2%::items::%{_oldID}%::price}
- set {Shop::shop::%arg-2%::items::%{_newID}%::cmds::*} to {Shop::shop::%arg-2%::items::%{_oldID}%::cmds::*}
- send "{@p} &aSlot &f%arg-3% &ahas been copied to slot &f%arg-4% &ain &f%arg-2% &acategory."
- stop
- if arg-1 is "removeitem" or "ri":
- if sender doesn't have permission "shop.removeitem":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop removeitem &f<category> &c<slot(integer)>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop removeitem <category> &f<slot(integer)>"
- stop
- set {_id} to arg-3 parsed as integer
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_exists1} to true
- if {_exists1} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- else:
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- if arg-2 is "main":
- delete {Shop::shop::%{_id}%::item}
- delete {Shop::shop::%{_id}%::price}
- remove {_id} from {Shop::shop::*}
- send "{@p} &aSlot &f%arg-3% &ahas been removed from &f%arg-2% &acategory."
- stop
- else:
- delete {Shop::shop::%arg-2%::items::%{_id}%::item}
- delete {Shop::shop::%arg-2%::items::%{_id}%::price}
- remove {_id} from {Shop::shop::%arg-2%::items::*}
- send "{@p} &aSlot &f%arg-3% &ahas been removed from &f%arg-2% &acategory."
- stop
- if arg-1 is "list" or "l":
- if sender doesn't have permission "shop.list":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop list &f<category/main>"
- stop
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- send "&7» &aShowing items list of category &f%arg-2%&a."
- send ""
- loop {Shop::shop::%arg-2%::items::*}:
- if {Shop::shop::%arg-2%::items::%loop-value%::cmds::*} is set:
- set {_cmds} to "%{Shop::shop::%arg-2%::items::%loop-value%::cmds::*}%"
- replace all ", " with "%nl% &7- &a" in {_cmds}
- replace all " and " with "%nl% &7- &a" in {_cmds}
- set {_cmds} to "%nl%&7Commands:%nl% &7- &a%{_cmds}%"
- else:
- set {_cmds} to ""
- json("%player%", " &7- &a%loop-value%||ttp:&7Item: %{Shop::shop::%arg-2%::items::%loop-value%::item}% &7(&a%colored name of {Shop::shop::%arg-2%::items::%loop-value%::item}%&7)%nl%&7Price: %{Shop::shop::%arg-2%::items::%loop-value%::price}%%{_cmds}%")
- delete {_cmds}
- send ""
- stop
- send "&7» &aShowing items list of category &f%arg-2%&a."
- send ""
- loop {Shop::shop::*}:
- if {Shop::shop::%loop-value%::price} is not set:
- set {_info} to "%nl%&7Slot: &a%{Shop::shop::%loop-value%::slot}%"
- else:
- set {_info} to "%nl%&7Price: &a%{Shop::shop::%loop-value%::price}%"
- json("%player%", " &7- &a%loop-value%||ttp:&7Item: %{Shop::shop::%loop-value%::item}%%{_info}%")
- send ""
- stop
- if arg-1 is "addcmd" or "acmd":
- if sender doesn't have permission "shop.addcmd":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop addcmd &f<category> &c<slot> <cmd without />"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop addcmd <category> &f<slot> &c<cmd without />"
- stop
- if arg-4 is not set:
- send "{@p} &7Usage: &c/shop addcmd <category> <slot> &f<cmd without />"
- stop
- set {_id} to arg-3 parsed as integer
- if first 4 characters of arg-3 contains "/":
- send "{@p} &cDon't include &c'/' &cin the beginning of the command."
- stop
- set {_id} to arg-3 parsed as integer
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_catExists} to true
- if {_catExists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_slotExists} to true
- if {_slotExists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- add arg-4 to {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}
- else:
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- add arg-4 to {Shop::shop::%{_id}%::cmds::*}
- send "{@p} &aAdded &f/%arg-4% &ato commands of slot &f%arg-3% &ain &f%arg-2% &acategory."
- stop
- if arg-1 is "removecmd" or "rcmd":
- if sender doesn't have permission "shop.removecmd":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop removecmd &f<category> &c<slot> <cmd without /> &7&oYou can use &c* &7&oin command field to remove all commands."
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop removecmd <category> &f<slot> &c<cmd without /> &7&oYou can use &c* &7&oin command field to remove all commands."
- stop
- if arg-4 is not set:
- send "{@p} &7Usage: &c/shop removecmd <category> <slot> &f<cmd without /> &7&oYou can use &c* &7&oin command field to remove all commands."
- stop
- set {_id} to arg-3 parsed as integer
- if first 4 characters of arg-3 contains "/":
- send "{@p} &cDon't include &c'/' &cin the beginning of the command."
- stop
- set {_id} to arg-3 parsed as integer
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_catExists} to true
- if {_catExists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_slotExists} to true
- if {_slotExists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- else:
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- if arg-4 != "*":
- if arg-2 is not "main":
- if {Shop::shop::%arg-2%::items::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- loop {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}:
- if loop-value = arg-4:
- set {_cmdExists} to true
- if {_cmdExists} is not set:
- send "{@p} &cCommand doesn't exist."
- stop
- remove arg-4 from {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}
- send "{@p} &aRemoved &f/%arg-4% &afrom commands of slot &f%arg-3% &ain &f%arg-2% &acategory."
- stop
- else:
- if {Shop::shop::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- loop {Shop::shop::%{_id}%::cmds::*}:
- if loop-value = arg-4:
- set {_cmdExists} to true
- if {_cmdExists} is not set:
- send "{@p} &cCommand doesn't exist."
- stop
- remove arg-4 from {Shop::shop::%{_id}%::cmds::*}
- send "{@p} &aRemoved &f/%arg-4% &afrom commands of slot &f%arg-3% &ain &f%arg-2% &acategory."
- stop
- else:
- if arg-2 is not "main":
- if {Shop::shop::%arg-2%::items::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- loop {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}:
- remove loop-value from {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}
- send "{@p} &aRemoved all commands of slot &f%arg-3% &ain &f%arg-2% &acategory."
- stop
- else:
- if {Shop::shop::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- loop {Shop::shop::%{_id}%::cmds::*}:
- remove loop-value from {Shop::shop::%{_id}%::cmds::*}
- send "{@p} &aRemoved all commands of slot &f%arg-3% &ain &f%arg-2% &acategory."
- stop
- if arg-1 is "cmds":
- if sender doesn't have permission "shop.cmds":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop cmds &f<category> &c<slot>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop cmds <category> &f<slot>"
- stop
- set {_id} to arg-3 parsed as integer
- if arg-2 is "main":
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-2% &cdoesn't exist."
- stop
- if {Shop::shop::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- send ""
- send "{@p} &aCommands of slot &f&l%arg-3% &ain category &f%arg-2%&a:"
- send ""
- loop {Shop::shop::%{_id}%::cmds::*}:
- json("%player%", " &7» &a/%loop-value% &7&o(Hover)||ttp:&c&nClick here to remove this command.||sgt:/shop removecmd %arg-2% %arg-3% %loop-value%")
- send ""
- stop
- else:
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_catExists} to true
- if {_catExists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_slotExists} to true
- if {_slotExists} is not set:
- send "{@p} &cSlot &f%arg-3% &cdoesn't exist."
- stop
- if {Shop::shop::%arg-2%::items::%{_id}%::cmds::*} is not set:
- send "{@p} &cSlot &f%arg-3% &chas no command."
- stop
- send ""
- send "{@p} &aCommands of slot &f&l%arg-3% &ain category &f%arg-2%&a:"
- send ""
- loop {Shop::shop::%arg-2%::items::%{_id}%::cmds::*}:
- json("%player%", " &7» &a/%loop-value% &7&o(Hover)||ttp:&c&nClick here to remove this command.||sgt:/shop removecmd %arg-2% %arg-3% %loop-value%")
- send ""
- stop
- if arg-1 is "give":
- if sender doesn't have permission "shop.give":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 parsed as offlineplayer is not set:
- send "{@p} &cMissing player name."
- stop
- if arg-3 parsed as number is not set:
- send "{@p} &cMissing shop amount &7&o(number)&c."
- stop
- set {_p} to arg-2 parsed as offlineplayer
- set {_pU} to uuid of {_p}
- add (arg-3 parsed as number) to player's balance
- send "{@p} &aAdded &f%arg-3% &ato &f%arg-2%&a's shop crystals. New balance: &f%player's balance%"
- stop
- if arg-1 is "take":
- if sender doesn't have permission "shop.take":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 parsed as offlineplayer is not set:
- send "{@p} &cMissing player name."
- stop
- if arg-3 parsed as number is not set:
- send "{@p} &cMissing shop amount &7&o(number)&c."
- stop
- set {_p} to arg-2 parsed as offlineplayer
- set {_pU} to uuid of {_p}
- remove (arg-3 parsed as number) from player's balance
- send "{@p} &aRemoved &f%arg-3% &afrom &f%arg-2%&a's shop crystals. New balance: &f%player's balance%"
- stop
- if arg-1 is "set":
- if sender doesn't have permission "shop.set":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 parsed as offlineplayer is not set:
- send "{@p} &cMissing player name."
- stop
- if arg-3 parsed as number is not set:
- send "{@p} &cMissing shop amount &7&o(number)&c."
- stop
- set {_p} to arg-2 parsed as offlineplayer
- set {_pU} to uuid of {_p}
- set player's balance to arg-3 parsed as number
- send "{@p} &f%arg-2%&a's shop crystals has been set to &f%arg-3%&a."
- stop
- if arg-1 is "balance" or "bal":
- if sender doesn't have permission "shop.balance":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &aBalance: &f%{PvPLevels::playerdata::%uuid of player%::crystals}%"
- stop
- else if arg-2 parsed as offlineplayer is set:
- send "{@p} &f%arg-2%&a's balance: &f%{PvPLevels::playerdata::%uuid of player%::crystals}%"
- stop
- if arg-1 is "size":
- if sender doesn't have permission "shop.size":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop size &f<category/main> &c<integer 1-6>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop size <category/main> &f<integer 1-6>"
- stop
- if arg-2 is "main":
- set {Shop::shop-size} to arg-3 parsed as integer
- else:
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_catExists} to true
- if {_catExists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- set {Shop::shop::%arg-2%::size} to arg-3 parsed as integer
- send "{@p} &aShop size of category &f%arg-2% &ahas been set to &f%arg-3%&a."
- stop
- if arg-1 is "background" or "bg":
- if sender doesn't have permission "shop.background":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if player's tool is air:
- send "{@p} &cYou must hold an item to do that."
- stop
- set {Shop::shop-background::item} to player's tool
- send "{@p} &aShop background items has been set to your tool."
- stop
- if arg-1 is "setprice" or "sp":
- if sender doesn't have permission "shop.setprice":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop setprice &f<category> &c<slot(integer)> <cost(number)>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop setprice <category> &f<slot(integer)> &c<cost(number)>"
- stop
- if arg-4 parsed as number is not set:
- send "{@p} &7Usage: &c/shop setprice <category> <slot(integer)> &f<cost(number)>"
- stop
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_exists1} to true
- if {_exists1} is not set:
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- if arg-2 is "main":
- set {_id} to arg-3 parsed as integer
- set {Shop::shop::%{_id}%::price} to arg-4 parsed as number
- send "{@p} &aSlot &f%arg-3% &aprice has been set to &f%arg-4% &ashop."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- set {Shop::shop::%arg-2%::items::%{_id}%::price} to arg-4 parsed as number
- send "{@p} &aSlot &f%arg-3% &7(in category &f%arg-2%&7) &aprice has been set to &f%arg-4% &ashop."
- stop
- if arg-1 is "setitem" or "si":
- if sender doesn't have permission "shop.setitem":
- send "{@p} &cYou don't have enough permissions to do that."
- stop
- if arg-2 is not set:
- send "{@p} &7Usage: &c/shop setitem &f<category> &c<slot(integer)>"
- stop
- if arg-3 parsed as integer is not set:
- send "{@p} &7Usage: &c/shop setitem <category> &f<slot(integer)>"
- stop
- if player's tool is air:
- send "{@p} &cYou must hold an item to do that."
- stop
- if name of player's tool is not set:
- send "{@p} &cYour item must have a name to do that."
- stop
- if arg-2 is not "main":
- loop {Shop::shop::*}:
- if loop-value = arg-2:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cCategory &f%arg-2% &cdoesn't exist."
- stop
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::%arg-2%::items::*}:
- if loop-value = {_id}:
- set {_exists1} to true
- if {_exists1} is not set:
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- loop {Shop::shop::*}:
- if loop-value = {_id}:
- set {_exists} to true
- if {_exists} is not set:
- send "{@p} &cSlot &f%arg-3% &calready exists."
- stop
- if arg-2 is "main":
- set {_id} to arg-3 parsed as integer
- set {Shop::shop::%{_id}%::item} to player's tool
- send "{@p} &aSlot &f%arg-3% &aitem has been set to your held item."
- stop
- else:
- set {_id} to arg-3 parsed as integer
- set {Shop::shop::%arg-2%::items::%{_id}%::item} to player's tool
- send "{@p} &aSlot &f%arg-3% &7(in category &f%arg-2%&7) &aitem has been set to your held item."
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement