I'm having trouble with this:
game.Players.PlayerAdded:connect(function(player) if player.Teams == Spectators then player.CameraMode = "LockFirstPerson" end end)
Thanks in advance!
function getTeamsColorFromName(name) local color for _,v in pairs(game.Teams:GetChildren()) do if v.Name == name then color = v.TeamColor end end return color end game.Players.PlayerAdded:connect(function(player) repeat wait() until player ~= nil -- This event is not very trust-worthy. if player.TeamColor == getTeamColorFromName("Spectators") then player.CameraMode = "LockFirstPerson" end end)
Broken down, the function at the top returns the Team's TeamColor from the name of it (Spectators) and then sets their CameraMode.
game.Players.PlayerAdded:connect(function(player) if player.Teams == "Spectators" then player.CameraMode = "LockFirstPerson" end end)
That should work? I can't test it, RobloxStudio crashes every 1 minute for me.