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

Setting up a players camera, a little help?

Asked by
Fad99 286 Moderation Voter
5 years ago

how come this script works:

wait()
local Player = game.Players.LocalPlayer
local Camera = game.workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.CameraPart.CFrame

but this one wont unless you respawn?

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = game.workspace.CurrentCamera

repeat wait()
    Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.CameraPart.CFrame

1 answer

Log in to vote
1
Answered by 5 years ago

Try this


local Camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer repeat wait() until player.Character Camera.CameraType = Enum.CameraType.Scriptable Camera.CFrame = game.Workspace.Camero.CFrame script.Parent.Parent.Parent.Stuff.Visible = true
0
Thank you for the effort, but i wasent looking for a script rather an explanation to why the first code works on spawn and the second one dosent. Fad99 286 — 5y
0
oh y8pogo123589 0 — 5y
Ad

Answer this question