Discord Thread How do i add a cooldown?

  • 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!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.
it doesnt work
code_language.skript:
on inventory click:
    if event-inventory is {rankedkits::%player%}:
        cancel event
        if index of event-slot is 10:
            cooldown: 10 seconds
            give player {VHK}
            give player {VCK}
            give player {VLK}
            give player {VBK}
            give player {VSK}
            give player {VPK}
            give player 6 golden apple

Posted by: veteo. from the skUnity Discord.
 
code_language.skript:
on inventory click:
    if event-inventory is {rankedkits::%player%}:
        cancel event
        if index of event-slot is 10:
            if difference between {cooldown::item::%player%} and now is smaller than 10 seconds:
                set {_s} to 10 seconds
                remove difference between now and {cooldown::item::%player%} from {_s}
                send "Wait %{_s}% before next usage" to player
            else:
                set {cooldown::item::%player%} to now
                give player {VHK}
                give player {VCK}
                give player {VLK}
                give player {VBK}
                give player {VSK}
                give player {VPK}
                give player 6 golden apple

Posted by: _grifin_ from the skUnity Discord.
 
Status
Not open for further replies.