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

Making a camera stay still when the player enters the game?

Asked by 5 years ago
Edited 5 years ago

So I am trying to make it so your screen is viewing a brick but I get this message in the output and don't know how to fix it would I use the Humanoid? "FireClient: player argument must be a Player object"

Script -

function PlayerAdded(player)
    game.ReplicatedStorage.remoteCam:FireClient(player)
end
PlayerAdded()

Local script -

game.ReplicatedStorage.TriggerCam.OnClientEvent:Connect(function()
    local camera = workspace.CurrentCamera
    local IntroChar = workspace.IntroChar

    camera.CameraType = Enum.CameraType.Scriptable
            camera.CameraSubject = IntroChar.Cam
            camera.CFrame = IntroChar.Cam.CFrame
end)
0
You need to bind PlayerAdded to game,Players.PlayerAdded instead of just calling the function protectiveebob 221 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Hi I'm BlackOrange and I will be helping you today.

The easiest solution to your issue is changing the Script to:

game.Players.PlayerAdded:Connect(function(plr)
    game.ReplicatedStorage.remoteCam:FireClient(plr)
end)

If you MUST do it the other way then:

local function PlayerAdded(player)
    game.ReplicatedStorage.remoteCam:FireClient(player)
end

game.Players.PlayerAdded:Connect(PlayerAdded)

Hoped this helped!

Best of luck developer!

Ad

Answer this question