Solved Simple Comand 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.

skrevtGHG

Member
May 12, 2017
2
0
0
36
Hello, I want to create a simple command with Cooldown for my server. But he does not work the way I would like it. Pls Help me
========================================================

code_language.skript:
command /feed:
    trigger:
        player has permission "lul":
            set {_diff} to difference between now and {sql_.diff::%player%}
            set the player's food level to 10
            {_diff} is less than 5 seconds:
                send "Wait 5 seconds."
                stop
            set {sql_.diff::%player%} to now
        else:
            send "nonono permission"
f70qed
 
Last edited:
Try this.
code_language.skript:
command /feed:
    trigger:
        player has permission "lul":
            set {_diff} to difference between {sql_.diff::%player%} and now
            set the player's food level to 10
            if {_diff} is less than 5 seconds:
                send "Wait %difference between 5 seconds and {_diff}% seconds."
            set {sql_.diff::%player%} to now
        else:
            send "nonono permission"
 
Just make the command and set a variable to now.
Then use the on command syntax and check if it is set, if it is then send the cool down message, if it isn't then don't.
 
Try this.
code_language.skript:
command /feed:
    trigger:
        player has permission "lul":
            set {_diff} to difference between {sql_.diff::%player%} and now
            set the player's food level to 10
            if {_diff} is less than 5 seconds:
                send "Wait %difference between 5 seconds and {_diff}% seconds."
            set {sql_.diff::%player%} to now
        else:
            send "nonono permission"
Thank u , its work <3
 
Status
Not open for further replies.