Hey all, I need some help with this bug that is happening with my script. No error, just not swapping teams when the button is clicked. I am a starter scripter, so please forgive me for me being kinda bad at scripting lol.
I’m not sure on why this isn’t working unless there is a naming issue or if the team doesn’t exist yet when the server side code runs. If you’re only relying on using print(player.Team) to check if the team was changed then you may need to add task.wait(1) before doing so as there is a delay between using :FireServer() and the remote event code running.
Try setting the player’s teamColor to the teamColor of the team you want it to change to instead of the team itself.
Ex: plr.TeamColor = (team color of the team you want)