Hello guys!
I've tried to make a skript plugin for tokens and coins.
You can win tokens and coins at crates, then you receive them with command /reward
.
But something is wrong in my code
When player types /reward and select "Coin-uri" or "Token-uri" the system doesn't send player message if he isn't holding an item or he doesn't has it...
And when player is holding the correct item named "Coin" or "Token" the system doesn't give him reward...
Code:
command /reward:
trigger:
open virtual chest with size 1 named "Alege" to player
make gui slot 3 of player with sunflower named "&6Coin-uri" to close
make gui slot 5 of player with sunflower named "&6Token-uri" to close
on inventory click:
if inventory name of player is "Alege":
if clicked slot is 3:
if name of player's tool is "&6&lCoin":
subtract 1 sunflower named "&6&lCoin" from player's inventory
add 1 to {coins.%player%}
send "[&6!&f] Ai primit &61x coins&f!" to player
stop
else:
send "[&c*&f] Nu ai un item numit &6&lCoin&f sau nu il ti in mana!" to player
stop
if clicked slot is 5:
if name of player's tool is "&6&lToken":
subtract 1 sunflower named "&6&lToken" from player's inventory
add 1 to {tokens.%player%}
send "[&6!&f] Ai primit &61x tokens&f!" to player
stop
else:
send "[&c*&f] Nu ai un item numit &6&lToken&f sau nu il ti in mana!" to player
stop
Sorry for my english xD
thanks.
I've tried to make a skript plugin for tokens and coins.
You can win tokens and coins at crates, then you receive them with command /reward
.
But something is wrong in my code
When player types /reward and select "Coin-uri" or "Token-uri" the system doesn't send player message if he isn't holding an item or he doesn't has it...
And when player is holding the correct item named "Coin" or "Token" the system doesn't give him reward...
Code:
command /reward:
trigger:
open virtual chest with size 1 named "Alege" to player
make gui slot 3 of player with sunflower named "&6Coin-uri" to close
make gui slot 5 of player with sunflower named "&6Token-uri" to close
on inventory click:
if inventory name of player is "Alege":
if clicked slot is 3:
if name of player's tool is "&6&lCoin":
subtract 1 sunflower named "&6&lCoin" from player's inventory
add 1 to {coins.%player%}
send "[&6!&f] Ai primit &61x coins&f!" to player
stop
else:
send "[&c*&f] Nu ai un item numit &6&lCoin&f sau nu il ti in mana!" to player
stop
if clicked slot is 5:
if name of player's tool is "&6&lToken":
subtract 1 sunflower named "&6&lToken" from player's inventory
add 1 to {tokens.%player%}
send "[&6!&f] Ai primit &61x tokens&f!" to player
stop
else:
send "[&c*&f] Nu ai un item numit &6&lToken&f sau nu il ti in mana!" to player
stop
Sorry for my english xD
thanks.
Last edited: