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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Error with cooldown

Discussion in 'Skript' started by Havent23, Jul 10, 2021.

Thread Status:
Not open for further replies.
  1. Havent23

    Havent23 Member

    Joined:
    Jul 10, 2021
    Messages:
    2
    Likes Received:
    0
    I'm trying to make a "scythe" but the cooldown isn't working.
    Any help?
    Here's the code:
    on right click on air:
    if player is holding iron hoe:
    cooldown: 20
    cooldown message: "&6You can only do this every 20 seconds."
    summon zombie at location of player
    equip last spawned zombie with iron helmet
    equip last spawned zombie with iron chestplate

    (Edit: If possible i would like to know if there is a way to makr them die after some time.)
     
    #1 Havent23, Jul 10, 2021
    Last edited: Jul 10, 2021
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    It's not necessary to put "on air" on line 1. Also, "cooldown 20" and the subsequent line can only be used when creating commands.

    I reccomend you doing this:

    Code (Skript):
    1. on right click:
    2.    if player is holding a iron hoe:
    3.       if {scythe.%player%.time} is not set:
    4.          summon zombie at player's location
    5.          equip last spawned zombie with iron helmet
    6.          equip last spawned zombie with iron chestplate
    7.          set {scythe.%player%.time} to true
    8.          wait 20 seconds
    9.          delete {scythe.%player%.time}
    10.       else:
    11.          message "&6You can only do this every 20 seconds." to event-player
    I haven't tested it, but it should work.
     
  3. Havent23

    Havent23 Member

    Joined:
    Jul 10, 2021
    Messages:
    2
    Likes Received:
    0
Thread Status:
Not open for further replies.

Share This Page

Loading...