I'm trying to make a gui to host a sword fight thing and I'm adding a cooldown to prevent abuse and it's not changing the value. I've tried editing the code, putting it in serverscriptservice, in the gui, in workspace, none work.
game.ReplicatedStorage.CooldownStart.OnServerEvent:Connect(function() if game.ReplicatedStorage.FIghtStarted.Value == false then game.ReplicatedStorage.FIghtStarted.Value = true game.ReplicatedStorage.NameStorageDupe.Value = script.Parent.Parent.Parent.Name game.ReplicatedStorage.ParticipateFight:FireAllClients() game.ReplicatedStorage.Cooldown.Value = 520 while true do game.ReplicatedStorage.Cooldown.Value = game.ReplicatedStorage.Cooldown.Value - 1 wait(1) if game.ReplicatedStorage.Cooldown.Value == 0 then game.ReplicatedStorage.FIghtStarted = false game.ReplicatedStorage.Cooldown.Value = 520 break end end end end)
Please help, is it where I'm putting it? It used to be just on mousebutton1up it runs but I tried changing it to OnServerEvent nothing is working
OOPS THIS ACTUALLY DOES WORK I JUST POSTED THIS BEFORE TESTING FBDIHFDSJ HFNSKLCM DJBNO