Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is the value not changing??

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

2 comments

0

please use more variables this code is very messy. for example local FightStarted = game.ReplicatedStorage.FIghtStarted.

0

It wasnt working when i used local but it works now so its fine

1 answer

OOPS THIS ACTUALLY DOES WORK I JUST POSTED THIS BEFORE TESTING FBDIHFDSJ HFNSKLCM DJBNO

This discussion is preserved as it was. New answers, comments, and votes are closed.