Check if player has enough balance with SkBee scoreboard

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Cats

Member
Oct 24, 2022
2
0
1
18
Category:
Skript scoreboard balance check
Suggested name:

Spigot/Skript Version:
Skript 2.6.3
What I want:
A skript that will check if the player has at least 50 on {balance::%player's uuid%}
I have a basic SkBee scoreboard, and when a player clicks, they get 1 balance.
{balance::%player's uuid%} is how much balance they have, and I want the code to check if they have
50 balance on {balance::%player's uuid%} BEFORE it takes away the 50, otherwise if the player doesnt have at least 50 on {balance::%player's uuid%}, I want it to cancel the event

Heres my code so far, without the balance check

on right click with oak button:

add -50 to {balance::%player's uuid%}
remove Sunflower from player's inventory
give player Red Mushroom named "&4Red Mushroom Clicker"

I don't want the player to go into the negatives, so I want the code to make sure they have 50 balance on {balance::%player's uuid%} before it actually takes it away, otherwise cancel the event.

Ideas for commands:

Ideas for permissions:
Players
When I'd like it by: Tommorrow