hello,
so im making a /buykit [<kitname>] command where it opens a gui to buy the kit. every reload is successful, but its not working. i think ive isolated the problem to the %arg-1% in the {%player%.kit.%arg-1%} variables. so executing "/kit" gives the error message for that to the player, and doing /kit [random name] works with the respected error message, but doing "/kit [fighter, archer, fisherman, or scout]" does nothing. any help?
thanks in advance for any answers.
so im making a /buykit [<kitname>] command where it opens a gui to buy the kit. every reload is successful, but its not working. i think ive isolated the problem to the %arg-1% in the {%player%.kit.%arg-1%} variables. so executing "/kit" gives the error message for that to the player, and doing /kit [random name] works with the respected error message, but doing "/kit [fighter, archer, fisherman, or scout]" does nothing. any help?
thanks in advance for any answers.
Code:
# buykit command
command /buykit [<text>]:
permission: kits.buykit
trigger:
if arg-1 is not set:
message "&c/buykit [kitname]" to player
if arg-1 is set:
if arg-1 is "fighter" or "archer" or "fisherman" or "scout":
if {%player%.kit.%arg-1%} is 1:
message "&cYou already own this kit" to player
if {%player%.kit.%arg-1%} is 0:
create a gui with id "%player%.buykit.%arg-1%" with virtual chest with 3 rows named "Buy Kit":
format gui slot 4 with an wooden sword named "&aBuy kit: &f%arg-1% &afor &f$100&a?":
cancel event
format gui slot 11 with an emerald block named "&a&lBuy Kit":
close player's inventory
message "&aYou have bought kit &f%arg-1% &afor &f$100"
set {%player%.kit.%arg-1%} to 1
format gui slot 15 with an redstone block named "&c&lCancel":
close player's inventory
format gui slot 22 with an gold block named "&6Price: &f$100":
cancel the event
wait 1 tick
open gui "%player%.buykit.%arg-1%" to player
else:
message "&cThat isn't a kit" to player