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)
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
actually, changing the Team Colour automatically changes the team for that player
@JellyYn can you give me an example of script? Also, chexy, that didnt work
and example would be like (inside the MouseButton1Down:Connect(function)) "game.Players.LocalPlayer.Team = game.Teams.Allies" I don't know for sure it works, but try it. Also, get rid of the LoadChar thing, and make sure the code is in a LocalScript
Worked, thank you SOO much!
No problem @gioreyes1234. Always happy to help