Hi,
I'm using Skript and Skript-GUI to create a battle pass thing and I'm facing this problem:
How can I make that the reward can be claimed only once?
I'm pasting here part of my code, can anyone please help me?
I'm using Skript and Skript-GUI to create a battle pass thing and I'm facing this problem:
How can I make that the reward can be claimed only once?
I'm pasting here part of my code, can anyone please help me?
code_language.skript:
create a gui with virtual chest inventory with 5 rows named "&6&lBattle Pass" and shape "xxxxxxxxx", "x-------x", "x-123---x", "x-------x", and "xobxpxhxx":
make gui slot "1" with sunflower named "&6Coins Reward" with lore {@bp1_lore}:
if {bpxp::%player%} is lower than 10000:
set {_needed} to difference between {bpxp::%player%} and 10000
cancel event
close player's inventory
send "&6&lBATTLE PASS! &7You need &b%{_needed}% XP &7to claim this reward!"
else:
send "&6&lBATTLE PASS! &7You received &620,000 Coins&7!"
add 20000 to {coins::%player%}
set {@bp1_lore} to string "&aClaimed"
close player's inventory
close player's inventory