Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

You need to bind PlayerAdded to game,Players.PlayerAdded instead of just calling the function

1 answer

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.