local startergui = game.StarterGui
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent:Destroy()
game.StarterGui:WaitForChild("MotherViewPrison",1):Destroy()
game.StarterGui:WaitForChild("Prisoners", 1):Destroy()
game.Players.LocalPlayer.Team = game.Teams.Police
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
end)
Even when the player dies, it doesn't load at the Team Spawn

1 comment
Make sure to turn off CharacterAutoLoading in a server script which can be done by doing game.Players.CharacterAutoLoads = false and to make sure you use Player:LoadCharacter() which can be done through server as well as client.