1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Cooldown issues

Discussion in 'Requests' started by thecodingninja, Oct 10, 2021.

  1. thecodingninja

    thecodingninja New Member

    Joined:
    Oct 10, 2021
    Messages:
    9
    Likes Received:
    0
    Code (Text):
    1.  
    2. on left click:
    3.   player is holding a blaze rod named "<gray>Necromancer Staff":
    4.     {wand.effect.%player%} is 1:
    5.       if {cooldown.%player%} is true:
    6.               message "&6you have to wait"
    7.               stop
    8.               cancel event
    9.           if {cooldown.%player%} isn't set:
    10.               set {cooldown.%player%} to false
    11.           if {cooldown.%player%} is false:
    12.               set {cooldown.%player%} to true
    13.         loop 4 times:
    14.           spawn zombie at player
    15.           set the weapon of last spawned entity to iron sword
    16.           set the name of last spawned entity to "<black>Undead Captain"
    17.           set last spawned entity's max health to 30
    18.               wait 1 minute
    19.               set {cooldown.%player%} to false
    20.         stop
    21.  
    I am making a necromancer staff but I have issues with the cooldown
     
  2. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    143
    Likes Received:
    5
    Code (Text):
    1. on left click with blaze rod:
    2.     name of tool is "<gray>Necromancer Staff"
    3.     {wand.effect.%player%} is 1:
    4.         if unix date of ((metadata tag "cooldown" of player) ? 0) wasn't less than 1 minute ago:
    5.             set metadata tag "cooldown" of player to unix timestamp of now
    6.             loop 4 times:
    7.                 spawn zombie at player
    8.                 set tool of last spawned zombie to iron sword
    9.                 set display name of last spawened zombie to "<black>Undead Captain"
    10.                 set max health of last spawned zombie to 30
    11.                 heal last spawned zombie
    12.         else:
    13.             send "Cooldown message!"
    try that (also try to change your variables to list variables)
     
  3. thecodingninja

    thecodingninja New Member

    Joined:
    Oct 10, 2021
    Messages:
    9
    Likes Received:
    0
    it worked, thank you
     

Share This Page

Loading...