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

Why doesn't While true do loop forever?

That's my script

local TimeValue = script.Parent.Parent.Values.Time
local PlayersValue = script.Parent.Parent.Values.Players
local BoatValue = script.Parent.Parent.Values.BoatReady

while true do
	print("script starts working again!")
	repeat
		wait(1)
	until BoatValue.Value == true
		TimeValue.Value = 20
		repeat
			TimeValue.Value = TimeValue.Value - 1
			wait(1)
		until TimeValue.Value == 0
		if PlayersValue.Value ~= 0 then
			BoatValue.Value = false
			repeat
				script.Parent.Transparency = script.Parent.Transparency + 0.01
				wait(0.01)
			until script.Parent.Transparency == 1
			wait(10)
		end	
	print("the end of the script, it should actually work again")
	wait()
end

It does everything without errors, warnings, or anything. It works fine, until the end. When it finishes, it doesn't repeat. How to fix this?

1 answer

repeat
    script.Parent.Transparency = script.Parent.Transparency + 0.01
    wait(0.01)
until script.Parent.Transparency == 1

These lines have already been executed , try reverting the changes done by the script at the start of the while loop before adding the rest of the lines. let me know if the transparency gets reset because I do not see the line of code where the transparency gets reset

1 comment

0

There wasn't anything like that yet

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