I have tried youtube for it but no use! Please help!

player = script.Parent.Parent.Parent.Parent
team = game.Teams["Vostik Military"]
function onButtonClicked()
player.TeamColor = team.TeamColor
end
script.Parent.MouseButton1Down:connect(onButtonClicked)

4 comments

1

Nothing wrong here assuming this is a GUI and all your paths are correct. You really should use a LocalScript and game.Players.LocalPlayer, though.

0

Well I wanted it to make sure the people are in my group before letting them switch

1

Then why didn't you say so? Anyways, you can use the IsInGroup() method of player.

0

Thank you!