I am trying to create a menu where you can choose a team and then spawn in the game.
For some reason the player does not spawn - only their team is set.
When the player clicks confirm, a RemoteEvent is fired to the server which spawns the player and sets their team.
Here is the code that spawns the user and sets their team. I cannot understand what is going wrong.
local otherTeam = team == Teams.Red and Teams.Blue or Teams.Red
if #team:GetPlayers() <= #otherTeam:GetPlayers() then
player.Team = team
player:LoadCharacter()
end