Cooldowns
Cooldowns in Skript
So, suppose you wanted to make a stick, that when you right click it, shoots a fire ball. You want a 2 second cooldown though. Well, you're in luck. The code shown below will allow you to do that.
Well, there's an issue with the code above. That only starts the cooldown, it would not check if a cooldown with that name is going on. So, what we want to do, is check if a cooldown with that name is going on.
So, that works just fine. Now, how do we see how long until the cooldown ends? Well, you can use this:
That will show us how long until that cooldown expires. So, what now? Lets improve the code above to tell us how long until the cooldown expires.
Also, if you wanted to, you could just forcefully end the cooldown. SimpleSK allows you to do that. So, lets make code where if the player has the permission "cooldown.skip", it ends the cooldown for them.
Perfect. Now, there's one last thing we didn't discuss. You can now see ALL of the cooldowns for the whole server. How? Well, lets make a command for it.
All we need now, is one line. You can use all active cooldowns to see all of the current cooldowns the server is in.
Then, it looks like we're done! Play around with this features yourself, now!
Last updated
Was this helpful?