Does anyone know how to fix this problem?
I have made a team changer GUI and I don't want to "kill" the player instead I just want to load the player in with player:LoadCharacter() if I can. The script will work in studio but it won't in game.
Here is my code.
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() player.TeamColor = BrickColor.new('Really red') player:LoadCharacter() end)
I am using a local script.
When using LoadCharacter(), I'd recommend you check the documentation. If you did, you would've saw that This item should be used in a Script to work as expected online.
That said, the way I did this was to fire a remoteevent with the team the person is changing to and have that in a script in ServerScriptService.