Explanation of what the skript should do:
- Every time someone buys something using buycraft, a permission of the set is assigned to the player.
- If a player has a permission, he can do "/kits" and then auto fill his bought kit/s.
- Only the one he bought will be displayed and working when claiming.
- Also, depending on which kit a player bought, he will either get 10, 20 or 30 totems.
Now the problem: If a player buys 2 kits, for example Kit "Bread" and kit "Apple", while "Apple" includes 10 and "Bread" includes 20 totems and he claims "Bread" using "/kits Bread", he will get the 20 totems from bread + the 10 totems from "Apple", as he has the permission "kits.permission.apple" and "kits.permission.bread".
How can I get it working that it only gives the totems of the kit the player is actually claiming? Here's my code:
- Every time someone buys something using buycraft, a permission of the set is assigned to the player.
- If a player has a permission, he can do "/kits" and then auto fill his bought kit/s.
- Only the one he bought will be displayed and working when claiming.
- Also, depending on which kit a player bought, he will either get 10, 20 or 30 totems.
Now the problem: If a player buys 2 kits, for example Kit "Bread" and kit "Apple", while "Apple" includes 10 and "Bread" includes 20 totems and he claims "Bread" using "/kits Bread", he will get the 20 totems from bread + the 10 totems from "Apple", as he has the permission "kits.permission.apple" and "kits.permission.bread".
How can I get it working that it only gives the totems of the kit the player is actually claiming? Here's my code:
Code:
command /kits <text>:
executable by: players
permission: kits.permission.skript
permission message: "&e&l[Kit Bot]: &4&lYou do not have the permission to use /kits!"
cooldown: 20 seconds
cooldown message: "&e&l[Kit Bot]: &4&lYou have to wait %remaining time% until you can claim this kit again!"
trigger:
if arg-1 is not set:
send "&e&l[Kit Bot]: &4Usage: /kits <NameOfKit>" to player
if arg-1 is set:
if player has permission "kits.permission.%arg-1%":
execute console command "/ie give %arg-1%Sword %player% 1"
execute console command "/ie give %arg-1%Axe %player% 1"
execute console command "/ie give %arg-1%Pickaxe %player% 1"
execute console command "/ie give %arg-1%Helmet %player% 1"
execute console command "/ie give %arg-1%Chestplate %player% 1"
execute console command "/ie give %arg-1%Leggings %player% 1"
execute console command "/ie give %arg-1%Boots %player% 1"
send "&e&l[Kit Bot]: &4&lYou succesfully received the %arg-1%-Kit!" to player
else:
send "&e&l[Kit Bot]: &4&lYou do not have the permission to claim this kit!" to player
if player has permission "kits.permission.zenitsu":
execute console command "/give %player% totem_of_undying 10"
if player has permission "kits.permission.tomioka":
execute console command "/give %player% totem_of_undying 20"
if player has permission "kits.permission.mitsuri":
execute console command "/give %player% totem_of_undying 30"
on tab complete of "/kits":
player has permission "kits.permission.zenitsu"
add "Zenitsu" to tab completions
player has permission "kits.permission.tomioka"
add "Tomioka" to tab completions
player has permission "kits.permission.mitsuri"
add "Mitsuri" to tab completions