How to i test if something has been executed

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Sympathischer

Member
Sep 18, 2022
13
0
1
24
How do i test if the function above has been executed??
I am making a skript for a server where you can buy ranks with ingame money (essentials econemy).
BUT if i dont have any money i can still buy the rank because the money simply doesn't get removed because you cant go minus.
Please Help!!


Code:
on inventory click:
    if player's current inventory's name is "&1Rank":
        if clicked slot isn't 10:
            cancel event
        else:
            if player has permission "skript.vip":
                message "&cDu hast diesen rang schon"
                close player's inventory
                cancel event
            else:
                if player has permission "skript.premium" or "skript.ultra" or "skript.mvp" or "skript.supreme" or "skript.gurke":
                    message "&cDu hast schon einen höheren rang"
                    close player's inventory
                    cancel event
                else:
                    execute console command "/eco take %player% 15000"
                    #if command has been execute: (placeholder)
                        execute console command "/lp user %player% parent set vip"
                        close player's inventory
                        message "&4Du hast den Rang gekauft!"
                        cancel event
 
You can just use:

Add {amount} to players balance
And
Take {amount} from players balance
It doesn't work
and it doesn't solve my problem because its still isn't testing if the function has been executed successfully so the bug still isn't fixed which means i can still buy the rank for free if i dont have any money
 
Sorry, Its actually

remove [amount] from players balance


If it is showing errors when reloading the skript, its probably because you don't have vault installed. If so, Please install it.
 
You could do
If {buyrank::%player%} is not set:
Set {buyrank::%player%} to “true”
# code here
 
Okay, this code will make it so if someone runs /hi it says "hello" but if they run it again it says "bye"

code_language.skript:
command /hi:
  trigger:
    if {hello::%player%} is not set:
      send "&aHello"
      set {hello::%player%} to "true"
    else:
      send "&cBye"
      delete {hello::%player%}
 
Okay, this code will make it so if someone runs /hi it says "hello" but if they run it again it says "bye"

code_language.skript:
command /hi:
  trigger:
    if {hello::%player%} is not set:
      send "&aHello"
      set {hello::%player%} to "true"
    else:
      send "&cBye"
      delete {hello::%player%}
I think that would work for men i am not at home so i cant test it but thanks