Im using the script below and it works just find other then that the players dont actually spawn on the correct teams spawn. From testing it, it just choses a random spawn and spawns the player there. Does anybody know why and how to fix it?
local plr = game.Players.LocalPlayer
_G.teamNumber1 = 0
_G.teamNumber2 = 0
local team1 = BrickColor.new('Bright blue')
local team2 = BrickColor.new('Bright red')
function Set()
if _G.teamNumber1 > _G.teamNumber2 then
plr.TeamColor = team2
_G.teamNumber2 = _G.teamNumber2 + 1
elseif
_G.teamNumber1 < _G.teamNumber2 then
plr.TeamColor = team1
_G.teamNumber1 = _G.teamNumber1 + 1
elseif
_G.teamNumber1 == _G.teamNumber2 then
--do math.random or watever u like, I'll just put him to Team1
plr.TeamColor = team1
_G.teamNumber1 = _G.teamNumber1 + 1
end
plr.Neutral = false
end
script.Parent.MouseButton1Click:connect(function()
Set()
plr:LoadCharacter()
end)

1 comment
Do the spawns have their TeamColor set properly, and also set to not Neutral?