Hello, how do I make that the value would go down by 1 every second?
Script:
while can.Value == true do wait(1) if player:FindFirstChild("Cooldowns") then if player.Cooldowns.A1.Value > 0 then player.Cooldowns.A1.Value = player.Cooldowns.A1.Value - 1 end if player.Cooldowns.A2.Value > 0 then player.Cooldowns.A2.Value = player.Cooldowns.A2.Value - 1 end end end
This scirpt sometimes works and sometimes it doesn't, i dont know why... Maybe there is another way around this?
Also, I do not get any errors.
Any help would be appreciated!
If Can.Value changes to false the script will stop and that entire part will not happen again at all, so put the while loop inside of another while true loop and then when the while can == true loop end it will wait until can is equal to true.
Try this:
while can.Value == true do wait(1) if player:FindFirstChild("Cooldowns") then if player.Cooldowns.A1.Value > 0 and player.Cooldowns.A2.Value > 0 then player.Cooldowns.A1.Value = player.Cooldowns.A1.Value - 1 player.Cooldowns.A2.Value = player.Cooldowns.A2.Value - 1 end end end