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

My script doesn't stop the water from raising?

So basically when the InRound bool val turns false it doesn't break the loop and there is no errors in da output here is da script btw:

local Water = workspace.Water
local InRound = game.ReplicatedStorage.InRound.Value
while true do
	if InRound == false then 
		break 
	end
	wait(.5)
	Water.Position = Water.Position + Vector3.new(0,1,0)
end


 

1 answer

✓ Accepted answer

The variable InRound is equal to the current boolean value of InRound, but does not actually keep a reference to the object, meaning the variable InRound will remain the same whether or not the value of the object changes. Change line 2 to:

local InRound = game.ReplicatedStorage.InRound

And line 4 to:

if InRound.Value == false then

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