Bool value in ReplicatedStorage not turning on

I have a bool value in ReplicatedStorage that is supposed to be turned to true via a serverscript in serverscriptservice, but it doesn’t change to true. There are no errors in output.

wait(3)

local RainEvent = game.ReplicatedStorage.RainEvent

while true do
	local RandomWait = math.random(10, 11)
	
	wait(RandomWait)
	RainEvent.Value = true
	
	local RandomWait2 = math.random(10, 11)
	
	RainEvent.Value = false
end

Your code doesn’t yield for a second time:

So it immediately gets set back to false again

wait(3)

local RainEvent = game.ReplicatedStorage.RainEvent

while true do
	local RandomWait = math.random(10, 11)
	
	wait(RandomWait)
	RainEvent.Value = true
	
	local RandomWait2 = math.random(10, 11)

	wait(RandomWait2)

	RainEvent.Value = false
end

Damn, beat me to it. (limit lol)

1 Like

you’re my hero thank you so much

1 Like

you’re hero number 2 lol thanks a bunch

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.