Different cooldowns?

  • 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.
Oct 21, 2020
1
0
1
23
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:
command /showinv [<text>]:
    trigger:
        if {stuff:%arg-1%::*} exists:
            if player has permission "aeskits.%arg-1%":
                set {_waited} to difference between {%arg-1%.%player's uuid%.lastused} and now
                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!"
                    stop
                set {_slot} to -1
                loop {stuff:%arg-1%::*}:
                    add 1 to {_slot}
                    give player loop-value
                    set {%arg-1%.%player's uuid%.lastused} to now
        else:
            send "Det kit findes ikke?"
              
      
command /testnu [<text>]:
    trigger:
        send "%{cooldown.kit.%arg-1%}%"
      
command /saveinv [<text>] [<number>]:
    trigger:
        loop all items in player's inventory:
            add loop-item to {stuff:%arg-1%::*}
        send "&a&l[✓] &fSaved &7&o%size of {stuff:%arg-1%::*}%&r&f items."
        add arg-1 to {ag.itemframechest::*}
        set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan

command /kits:
    trigger:
        loop {ag.itemframechest::*}:
            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
 
What is the error?

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