tnt cooldown help

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

Status
Not open for further replies.

blorbee

Member
Aug 5, 2020
2
0
0
24
i been looking all over the place for an answer and only found one that DOESNT WORK WITH MY SKRIPT!
pelase help

Code:
on rightclick holding dispenser:
    if {_Waiting} is true:
        cancel event
        send "&6You're on Cooldown, Please wait!"
        wait 5 seconds
        set {_Waiting} to false
        stop
    if {_Waiting} is false:
       player has 1 tnt
       spawn a primed tnt 1 meter above the player
       push the spawned entity in direction of player at speed 0.9
       push the spawned entity upwards at speed 0.2
       remove 1 tnt from player
       set {_Waiting} to true
on place dispenser:
    cancel event
 
You are using a local variable which gets deleted after the code ends, so the {_Waiting} variable is not set to true nor false so it will not do anything. Instead try changing it to "{-waiting::%player%}" and make sure that the {-waiting::%player%} variable is set to true or false.
 
i been looking all over the place for an answer and only found one that DOESNT WORK WITH MY SKRIPT!
pelase help

Code:
on rightclick holding dispenser:
    if {_Waiting} is true:
        cancel event
        send "&6You're on Cooldown, Please wait!"
        wait 5 seconds
        set {_Waiting} to false
        stop
    if {_Waiting} is false:
       player has 1 tnt
       spawn a primed tnt 1 meter above the player
       push the spawned entity in direction of player at speed 0.9
       push the spawned entity upwards at speed 0.2
       remove 1 tnt from player
       set {_Waiting} to true
on place dispenser:
    cancel event
Code:
on rightclick holding dispenser:
    if difference between {Waiting::%player%} and now is not more than 5 seconds:
        cancel event
        send "&6You're on Cooldown, Please wait!"
        stop
    else:
       player has 1 tnt
       spawn a primed tnt 1 meter above the player
       push the spawned entity in direction of player at speed 0.9
       push the spawned entity upwards at speed 0.2
       remove 1 tnt from player
       set {Waiting::%player%} to now
on place dispenser:
    cancel event
[doublepost=1599447786,1599447414][/doublepost]
Code:
on rightclick holding dispenser:
    if difference between {Waiting::%player%} and now is not more than 5 seconds:
        cancel event
        send "&6You're on Cooldown, Please wait!"
        stop
    else:
       player has 1 tnt
       spawn a primed tnt 1 meter above the player
       push the spawned entity in direction of player at speed 0.9
       push the spawned entity upwards at speed 0.2
       remove 1 tnt from player
       set {Waiting::%player%} to now
on place dispenser:
    cancel event
If the first one doesn't work try this one
Code:
on rightclick holding dispenser:
    if {Waiting::%player%} is not set:
       player has 1 tnt
       spawn a primed tnt 1 meter above the player
       push the spawned entity in direction of player at speed 0.9
       push the spawned entity upwards at speed 0.2
       remove 1 tnt from player
       set {Waiting::%player%} to now
    else:
        if difference between {Waiting::%player%} and now is not more than 5 seconds:
            cancel event
            send "&6You're on Cooldown, Please wait!"
            stop
        else:
            player has 1 tnt
            spawn a primed tnt 1 meter above the player
            push the spawned entity in direction of player at speed 0.9
            push the spawned entity upwards at speed 0.2
            remove 1 tnt from player
            set {Waiting::%player%} to now
on place dispenser:
    cancel event
on quit:#this is so as not to overload the server with varariables
    delete {Waiting::%player%}
on unload:#this is so as not to overload the server with varariables
    delete {Waiting::*}
 
Status
Not open for further replies.