Script doesn't work

  • 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 community!

    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.

IsaacGamerMC

New Member
Aug 31, 2020
6
0
1
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
 
I don't think it's possible to add a negative value to a variable, however I might be wrong. (
Code:
add -1 to {explosive_blade_cooldown}
)
But still, I think you would need to change it to
Code:
subtract 1 from {explosive_blade_cooldown}
 
Status
Not open for further replies.