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

How do I set the local players camera to the front surface of a block?

Asked by 3 years ago

i wanna make the character look at a item, and a blocks front surface is the view point, but when i step on the block, it says: Attempt to index nil with "Camera" on line 10?

--Variables--
local Brick = script.Parent
--End--

--Code--
local function PlayerTouched(Part)
    local Parent = Part.Parent
    if game.Players:GetPlayerFromCharacter(Parent) then
        script.Parent.Sound:Play()
        game.Players.LocalPlayer.Camera = workspace.Cameras.YourHand.FrontSurface
    end
end
Brick.Touched:connect(PlayerTouched)
0
Is this a local script? johnoscarbhv1 137 — 3y
0
yes Jakob_Cashy 79 — 3y
0
Local script doesnt work in workspace johnoscarbhv1 137 — 3y
0
Local script doesnt work in workspace johnoscarbhv1 137 — 3y

Answer this question