For example, when the player chooses team "prisoner" then they spawn in the jail, whereas if the player choose team "police" they spawn in a police station.
I have this code here trying to do what I mentioned up:
localscript:
local RemoteEvent = game.ReplicatedStorage.ChangeTeam
local player = game.Players.LocalPlayer
frame.prisoner.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(CitizenColor))
frame.Visible = not frame.Visible
player.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.citizen.Position + Vector3.new(0, 10, 0))
Remote Event: "ChangeTeam"
SeverScriptService:
game.ReplicatedStorage.ChangeTeam.OnServerEvent:Connect(function(player,teamColor)
player.TeamColor = teamColor
player:LoadCharacter()
end)
But the problem is that the player spawns on where I want it to spawn, then it immediately spawns on another spawn location. The Humanoid won't stay in the place where I want it to spawn :/
How do I fix this problem so that when a player chooses "prisoner" or any other team and spawns at a particular place set for that team.

2 comments
Won't there be issues with asynchronously calling LoadCharacter from the server and setting the CFrame of the client at the same time?
I guess not?