How to add a cooldown of 15 seconds

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

varboosted

Active Member
Apr 20, 2020
50
3
8
24
Code:
on shoot:
    shooter is player
    "%projectile%" is "arrow"
    name of tool of shooter is "&cSpam!"
    {nospam::%shooter%} is not set
    set {nospam::%shooter%} to true
    wait a tick
    loop 2 times:
        shooter has an arrow
        make shooter shoot a arrow
        wait a tick
    delete {nospam::%shooter%}
How can I make a cooldown every time after he shoots?
 
I didn't mean this, I mean that there will be cooldown each time it shoot 3 arrows

Code:
options:
  cooldown: 5 # in seconds

on shoot:
  if {arrowsshot::%shooter's uuid%} is more than or equal to 3:
    if {cooldown::%shooter's uuid%} is true:
      stop
    else:
      set {cooldown::%shooter's uuid%} to true
      wait {@cooldown} seconds
      clear {cooldown::%shooter's uuid%}
    cancel event
  else:
    add 1 to {arrowsshot:%shooter's uuid%}
This should work depending on what you want.
 
Status
Not open for further replies.