so I was trying to make a sword that implodes, deal damage to zombies and heal all players but it has a 60 second cooldown, but the cooldown timer doesn't work and it always says in the chat "This ability is on cooldown for -6 seconds" or another negative integers, plz can u fix my script. It would be nice if you could also make the safe explosion not damage and knockback all players.
on rightclick with diamond sword:
name of player's tool contain "Explosive Blade":
# [SmartFix] TODO
if {explosive_blade_cooldown} < 1:
# [SmartFix] TODO
apply potion of regeneration 10 to all players for 3 second
wait 1 seconds
create a safe explosion of force 2 at player
loop all zombies in radius 4 around player:
damage loop-entity by 20
set {explosive_blade_cooldown} to 60
else:
# [SmartFix] TODO
send "Explosive Blast is on cooldown for %{explosive_blade_cooldown}% seconds"
stop
every 1 seconds:
if {explosive_blade_cooldown} > 0:
# [SmartFix] TODO
add -1 to {explosive_blade_cooldown}
wait 1 seconds
on script load:
set {explosive_blade_cooldown} to 0
on rightclick with diamond sword:
name of player's tool contain "Explosive Blade":
# [SmartFix] TODO
if {explosive_blade_cooldown} < 1:
# [SmartFix] TODO
apply potion of regeneration 10 to all players for 3 second
wait 1 seconds
create a safe explosion of force 2 at player
loop all zombies in radius 4 around player:
damage loop-entity by 20
set {explosive_blade_cooldown} to 60
else:
# [SmartFix] TODO
send "Explosive Blast is on cooldown for %{explosive_blade_cooldown}% seconds"
stop
every 1 seconds:
if {explosive_blade_cooldown} > 0:
# [SmartFix] TODO
add -1 to {explosive_blade_cooldown}
wait 1 seconds
on script load:
set {explosive_blade_cooldown} to 0