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

How can I change a players camera when they respawn, and are only on a certain team?

Asked by 4 years ago

I have it set so that when a player respawns, it checks if they are on the right team, and then changes their camera but its not working?

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

local character = player.CharacterAdded or player.CharacterAdded:Wait()

player.CharacterAdded:Connect(function()
    if player.Team == game.Teams.Coremen then 
        player.CameraAssist.Value = true 
        camera.CameraType = Enum.CameraType.Scriptable
        camera.CFrame = workspace.CoremenCamera.CFrame 
    end
end)

1 answer

Log in to vote
0
Answered by
Arkrei 389 Moderation Voter
4 years ago
Edited 4 years ago

Try adding local Teams = game:GetService("Teams")

then check if player.Team == Teams.Coremen

make sure to put prints inside the events as a sort of "debug" to make sure if things are running

Ad

Answer this question