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

Is there a way to bypass the "Script timeout: exhausted allowed execution time" error?

Here is my code:

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
	for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
		if v:IsA("BasePart") then
			v.Transparency = 1
		end
	end
end

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
	for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
		if v:IsA("BasePart") then
			v.Transparency = 0
		end
	end
end

Any suggestions?

1 comment

1

add a wait() to the while loops

2 answers

✓ Accepted answer

add a wait()

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 1
        end
    end
wait()
end

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 0
        end
    end
wait()
end

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