Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to remove while true do loop?

Asked by 10 years ago

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 
0
Do you mean a break? GoldenPhysics 474 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

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.

0
Thanks! soap925 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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

Answer this question