Discord Thread I want to add a cooldown to add a 2 minute and 30 second cooldown to each button/block in a GUI.

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

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.
code_language.skript:
on inventory click:
  clicked slot = 0
  set {cooldown::%player%} to 150 seconds ago if {cooldown::%player%} isn't set
  if difference between now and {cooldown::%player%} < 150 seconds:
    stop
    cancel event
  set {cooldown::%player%} to now
  # execute code

Posted by: 3meraldk from the skUnity Discord.
 
i just changed the position on the line and it worked
but im gonna check if there are any more errors

this is the sk info
So i read your tutorial on skUnity eult and i came up with this. I am really new with script so i just wanted to ask what is wrong, because there are some errors.

Posted by: duyzi from the skUnity Discord.
 
code_language.skript:
applescript
on event:
    set {_waited} to difference between {cooldown::%player's uuid%} and now
    if {_waited} is less than 10 seconds:
        send "Try again in %difference between 10 seconds and {_waited}%"
        stop
    else:
        set {cooldown::%player's uuid%} to now
        #do event here

Posted by: eult from the skUnity Discord.
 
Status
Not open for further replies.