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

How to remove while true do loop?

Sooo, i was creating a racing game, and at then Car selection screen, I wanted to create a Cutscene If the "Next Car Button" is pressed. Unfortunately, i locked the camera on While True Do Loop. Is there any way i can remove a while true do loop?

local cam = workspace.CurrentCamera
cam.CameraSubject = workspace.CameraPart
cam.CameraType = "Attach"

while (true) do
game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(66.767, 16.99, 39.092)
game.Workspace.CurrentCamera.Focus = CFrame.new(66.906, 0.49, 12.629)
wait()
end 

1 comment

0

Do you mean a break?

2 answers

You know, you don't always have to use True in a while loop. For example,

local Value = true
while Value do
	--do stuff
end

If Value becomes false, this loop will stop.

1 comment

0

Thanks!

it's really simple if you only want to run a loop once then

while true do
wait(4)
s.Parent.Value = 48938
break
end

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