Error with 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.

Havent23

Member
Jul 10, 2021
2
0
1
18
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.)
 
Last edited:
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.)
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_language.skript:
on right click:
   if player is holding a iron hoe:
      if {scythe.%player%.time} is not set:
         summon zombie at player's location
         equip last spawned zombie with iron helmet
         equip last spawned zombie with iron chestplate
         set {scythe.%player%.time} to true
         wait 20 seconds
         delete {scythe.%player%.time}
      else:
         message "&6You can only do this every 20 seconds." to event-player
I haven't tested it, but it should work.
 
Status
Not open for further replies.