I'm using a plugin called Coinsengine for a coins currency system. it does not come with it's own coinshop gui so i'm skripting one myself. I am very much not experienced and i need help making it so that the 'cow spawner' can only be bought if the player has at least 20 coins because just making it take the coins using console lets the player continuously buy more spawners even if they have no coins left. Here is the skript in just the area i need help with:
on inventory click:
if name of event-inventory is "&eCoin Shop":
cancel event
if event-item is not set:
stop
make console execute command "coins take %player% 20"
make console execute command "give %player% cow_spawner 1"
play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 to player
send "&aYou bought a &5Cow Spawner &afor &e20 coins&a!" to player
on inventory click:
if name of event-inventory is "&eCoin Shop":
cancel event
if event-item is not set:
stop
make console execute command "coins take %player% 20"
make console execute command "give %player% cow_spawner 1"
play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 to player
send "&aYou bought a &5Cow Spawner &afor &e20 coins&a!" to player