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 out 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.

Different cooldowns?

Discussion in 'Skript' started by Asbjørn Giese Jørgensen, Nov 1, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Asbjørn Giese Jørgensen

    Joined:
    Oct 21, 2020
    Messages:
    1
    Likes Received:
    0
    Hello everyone :emoji_slight_smile:
    I'm trying to make a "kitadder" script. the thing that's really hard for me, is that I can't make a different cooldown for each kit.

    The code is a little messy, I know... I will fix it when I find out how to set different cooldowns!

    Code (Text):
    1. command /showinv [<text>]:
    2.     trigger:
    3.         if {stuff:%arg-1%::*} exists:
    4.             if player has permission "aeskits.%arg-1%":
    5.                 set {_waited} to difference between {%arg-1%.%player's uuid%.lastused} and now
    6.                 if {_waited} is less than {cooldown.kit.%arg-1%} seconds:
    7.                     message "You have to wait %difference between {cooldown.kit.%arg-1%} seconds and {_waited}% before you can use this command again!"
    8.                     stop
    9.                 set {_slot} to -1
    10.                 loop {stuff:%arg-1%::*}:
    11.                     add 1 to {_slot}
    12.                     give player loop-value
    13.                     set {%arg-1%.%player's uuid%.lastused} to now
    14.         else:
    15.             send "Det kit findes ikke?"
    16.              
    17.      
    18. command /testnu [<text>]:
    19.     trigger:
    20.         send "%{cooldown.kit.%arg-1%}%"
    21.      
    22. command /saveinv [<text>] [<number>]:
    23.     trigger:
    24.         loop all items in player's inventory:
    25.             add loop-item to {stuff:%arg-1%::*}
    26.         send "&a&l[✓] &fSaved &7&o%size of {stuff:%arg-1%::*}%&r&f items."
    27.         add arg-1 to {ag.itemframechest::*}
    28.         set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan
    29.  
    30. command /kits:
    31.     trigger:
    32.         loop {ag.itemframechest::*}:
    33.             send "%loop-value%" to player
    The problems are here:
    if {_waited} is less than {cooldown.kit.%arg-1%} seconds:
    message "You have to wait %difference between {cooldown.kit.%arg-1%} seconds and {_waited}% before you can use this command again!"

    set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan
     
  2. Marsbar

    Marsbar Active Member

    Joined:
    Mar 31, 2019
    Messages:
    131
    Likes Received:
    4
    What is the error?

    Og jeg er også dansk så vi er bare mega nice.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...