Solved Kits 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!

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

BestGamerNL

Member
Apr 25, 2017
38
1
0
25
heey guys im working on a factions server and of course there must be some kits in the game
now i have created all kits but i have one problem and that is the cooldown does someone know how to fix this it will help me a lot

this is my skript what i made

code_language.skript:
command /kit [<text>]:
    trigger:
        if arg 1 is "vip":
            message "&a&lvip &7kit selected!"
            give 1 diamond sword of unbreaking 3, sharpness 1 named "&a&lVip Sword" to player
            give 1 bow of unbreaking 2, power 2 named "&a&lVip Bow" to player
            give 64 arrow to player
            give 16 steak to player
            give 10 golden apple to player
            give 16 ender pearl to player
            give 32 xp bottle to player
            give 32 obsidian to player
            give 64 tnt to player
            equip player with iron Helmet of unbreaking 3, protection 2 named "&a&lVip Helmet"
            equip player with iron ChestPlate of unbreaking 3, protection 2 named "&a&lVip ChestPlate"
            equip player with iron Leggings of unbreaking 3, protection 2 named "&a&lVip Leggings"
            equip player with iron Boots of unbreaking 3, protection 2 named "&a&lVip Boots"
 
Yeah that is what i want but where do i need to paste it in my skript can you let me see an example
The idea behind a cooldown system is that you check a variable that has a time (the last time the command was successfuly executed) and compare it to the time it is right now. If the difference between those two values is less than the amount of time you want the player to wait to execute the command again, you cancel the event and stop the script.
So, in skript, you first check if the variable has been created beforehand. If it's not, you create it and set the time to now, remove the cooldown from the variable to allow it to execute and then check the variable to see if you're allowed to execute the command.

As this is the help forum and not the request forum, im giving you the idea to let you do it by youself. If you want to be spoonfeed you just go to the request section and post there. Note that it's going to be difficult for you to get a script handled to you because of yes, but you can try anyway.
 
Status
Not open for further replies.