local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Camera = workspace.CurrentCamera local PlayButton = script.Parent.PLAY repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable PlayButton.MouseButton1Click:Connect(function() PlayButton:Destroy() wait(2.5) Camera.CameraType = Enum.CameraType.Custom end) while true do Camera.CFrame = workspace.CameraPart.CFrame wait(4) Camera.CFrame = workspace.CameraPart2.CFrame wait(4) end
after i click playbutton it still does not end the while true loop how would i fix this.
this is affecting my players camera.
can someone tell me how to end the while true loop?
I think this might work, if not maybe try putting the MouseButton1Click:Connect inside the while loop and use break
.
local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Camera = workspace.CurrentCamera local PlayButton = script.Parent.PLAY local click = true repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable PlayButton.MouseButton1Click:Connect(function() click = false PlayButton:Destroy() wait(2.5) Camera.CameraType = Enum.CameraType.Custom end) while click do Camera.CFrame = workspace.CameraPart.CFrame wait(4) Camera.CFrame = workspace.CameraPart2.CFrame wait(4) end