Team spawns not working although everything is set up correctly

Hello DevForum! This is my first post here:

I have made a team change GUI with RemoteEvents (to clarify that I didn’t do it client-side only). The way it works is that it puts a player as neutral by default, if a team is chosen, a remote event is fired and the player is teamed to the right team and then player:LoadCharacter(). If a player doesn’t select a team tho, they are automatically put into Inmate team. This is how it all looks:

Team change UI handler (Client)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeamChange = ReplicatedStorage:WaitForChild("TeamChange")
local LoadCharacter = ReplicatedStorage:WaitForChild("LoadCharacter")

local Inmate = "Gold"
local Staff = "Storm blue"

script.Parent.MenuFrame.PLAY.TextButton.MouseButton1Click:Connect(function()
	script.Parent.Enabled = false
	game.Players.LocalPlayer.PlayerGui.MainMenuBG.Enabled = false
	LoadCharacter:FireServer()
end)

script.Parent.MenuFrame.PLAY.MAINS.Inmate.MouseButton1Click:Connect(function()
	TeamChange:FireServer(BrickColor.new(Inmate))
end)

script.Parent.MenuFrame.PLAY.MAINS.Staff.MouseButton1Click:Connect(function()
	TeamChange:FireServer(BrickColor.new(Staff))
end)
Team change handler (Server)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
ReplicatedStorage.TeamChange.OnServerEvent:Connect(function(player, teamColor)
	player.TeamColor = teamColor
end)

ReplicatedStorage.LoadCharacter.OnServerEvent:Connect(function(player)
	if player.Neutral ~= true then
		player:LoadCharacter()
	else
		player.Neutral = false
		player.TeamColor = BrickColor.new("Gold")
		player:LoadCharacter()
	end
end)

And now the problem: why doesn’t my character appear on the right spawn pad?

What's happening (Video)

Screen Recording 2022 06 22 at 20 13 07 - YouTube

All the spawns are set correctly (at least I think so)

Screenshots


Screenshot 2022-06-22 at 20.20.21

Is it Roblox or did I miss something? Please give me an answer if possible, thanks!

Are you changing a player’s teams on the client-side (via a local script) or on the server (via a server script), Roblox’s engine does not respect most changes that occur on the client.

1 Like

server side. I’m firing a remote function and it changes on server (you can see the scripts I included)