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
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.
Well I wanted it to make sure the people are in my group before letting them switch
Then why didn't you say so? Anyways, you can use the IsInGroup() method of player.
Thank you!