I am trying to make a teamchanger gui issue is everytime I try changing teams it creates a new team (Neutral) and puts me in it. I already have one team that is autoassignable which is citizens then I got 2 teams one is prisoner and the other cop which has autoassignable off.
Local script in button
script.Parent.MouseButton1Click:Connect(function()
local team = script.Parent.Text
game.ReplicatedStorage.ChangedTeam:FireServer(team.Value)
end)
Script in Severscriptservice
game.ReplicatedStorage.ChangedTeam.OnServerEvent:Connect(function(player, team)
player.Team = team
player:LoadCharacter()
end)

3 comments
It stopped making the neutral team but it completely doesn't work and comes up with an error: cannot assign team something like that
That issue is caused by the server script listening for the remote. Check my edit.
Thank you so much it works now!!