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

What should I change to make my Camera CFrame loop until spawned?

Asked by 5 years ago

I have a Main Menu Gui that once spawned cycles through 3 different camera parts. Yet it only cycles through once and I cannot figure out the correct way of coding the loop.

-- Locals --

local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer


-- Main Script --

repeat wait() until player.Character
    camera.CameraType = "Scriptable"
    camera.CFrame = game.Workspace.CAM1.CFrame
    wait(3)
    camera.CFrame = game.Workspace.CAM2.CFrame
    wait(3)
    camera.CFrame = game.Workspace.CAM3.CFrame
    wait(3)

Also note I want this loop to break once spawned. I think im supposed to use the, "for I, v in pairs" loop but I don't know the correct way of going about this.

Thanks

~GoodkidMad

0
Explain more please sfant43 20 — 5y

Answer this question