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

    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.
Take out the "else" line, since you have stops on your other if statements. the else is stopping the time variable from being set I think.
 
Take out the "else" line, since you have stops on your other if statements. the else is stopping the time variable from being set I think.
Didn't work. Instead, it sends the waffle sentence, and then the sentence about having to wait, but it didn't stop it from broadcasting again.
 
forgive me lol just got up. try this
code_language.skript:
command /waffle:
    description: Eat a waffle.
    permission: action.waffle
    executable by: players
    trigger:
        set {_diff} to difference between {sql_.diff::%player%} and now
        if {_diff} is less than 30 seconds:
            send "&cYou must wait &b%difference between 30 seconds and {_diff}% &cbefore you can do that again!"
            stop
        if player is muted:
            send "&cYou can\'t do that while muted!"
            stop
        else:
            broadcast "&e%player% ate a waffle."
        set {sql_.diff::%player%} to now
 
forgive me lol just got up. try this
code_language.skript:
command /waffle:
    description: Eat a waffle.
    permission: action.waffle
    executable by: players
    trigger:
        set {_diff} to difference between {sql_.diff::%player%} and now
        if {_diff} is less than 30 seconds:
            send "&cYou must wait &b%difference between 30 seconds and {_diff}% &cbefore you can do that again!"
            stop
        if player is muted:
            send "&cYou can\'t do that while muted!"
            stop
        else:
            broadcast "&e%player% ate a waffle."
        set {sql_.diff::%player%} to now
Thank you so much for the help, but it's doing the same thing.
 
forgive me lol just got up. try this
code_language.skript:
command /waffle:
    description: Eat a waffle.
    permission: action.waffle
    executable by: players
    trigger:
        set {_diff} to difference between {sql_.diff::%player%} and now
        if {_diff} is less than 30 seconds:
            send "&cYou must wait &b%difference between 30 seconds and {_diff}% &cbefore you can do that again!"
            stop
        if player is muted:
            send "&cYou can\'t do that while muted!"
            stop
        else:
            broadcast "&e%player% ate a waffle."
        set {sql_.diff::%player%} to now
That else triggers when the player isn't muted, doesn't check whether the cooldown is working; it should be if, else if and else for it to work properly.

Also, if you're using 1.9+ and the bensku's fork, you can get this version:
https://github.com/bensku/skript-build/blob/master/2.2-180203-git-2285953.jar

And do it the following way:

code_language.skript:
command /waffle:
  description: Eat a waffle
  permission: action.waffle
  executable by: players
  cooldown: 10 seconds
  #cooldown bypass: group.vip
  cooldown message: <red>You must wait <aqua>%remaining time% <red>before you can do that again!
  trigger:
    if player is muted:
      send "You can't do that while muted!"
    else:
      broadcast "%sender% ate a waffle"
 
Status
Not open for further replies.