I'm doing a team change gui and the team changing line doesnt work. For example:
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright red") game.Players.LocalPlayer:LoadCharacter() end)
You have to make it so their Team is TeamNameHere
, not just TeamColor
. Doing TeamColor
should just change their color, not their actual team.
Just note, LoadCharacter can only be called from the server.
Try this code instead, make sure it's a LocalScript for it to work.
local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:Connect(function() player.TeamColor = BrickColor.new('Bright red') end)