1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Simple Comand Cooldown [Help]

Discussion in 'Skript' started by skrevtGHG, May 12, 2017.

Thread Status:
Not open for further replies.
  1. skrevtGHG

    skrevtGHG Member

    Joined:
    May 12, 2017
    Messages:
    2
    Likes Received:
    0
    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 (Skript):
    1. command /feed:
    2.     trigger:
    3.         player has permission "lul":
    4.             set {_diff} to difference between now and {sql_.diff::%player%}
    5.             set the player's food level to 10
    6.             {_diff} is less than 5 seconds:
    7.                 send "Wait 5 seconds."
    8.                 stop
    9.             set {sql_.diff::%player%} to now
    10.         else:
    11.             send "nonono permission"
    [​IMG]
     
    #1 skrevtGHG, May 12, 2017
    Last edited: May 12, 2017
  2. Best Answer:
    Post #2 by ShaneBee, May 12, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Try this.
    Code (Skript):
    1. command /feed:
    2.     trigger:
    3.         player has permission "lul":
    4.             set {_diff} to difference between {sql_.diff::%player%} and now
    5.             set the player's food level to 10
    6.             if {_diff} is less than 5 seconds:
    7.                 send "Wait %difference between 5 seconds and {_diff}% seconds."
    8.             set {sql_.diff::%player%} to now
    9.         else:
    10.             send "nonono permission"
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Thank u , its work <3
     
Thread Status:
Not open for further replies.
Loading...