Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How i change player's team on textbutton click?

Hey im trying to make a button so when player clicks it changes his team but its doesn't work

RedButton.MouseButton1Click:Connect(function()
	Player.Teams = Player.Team.Red
end)

error: Red is not a valid member of Team

1 comment

0

more info plxs, what's your hierarchy? what is Team supposed to be? a folder?

1 answer

RedButton.MouseButton1Click:Connect(function()
    Player.Team = game.Teams.Red
end)

Teams isnt a property of player u should just do Team also when changing a team u need to get the team from game.Teams the player does not have these teams stored :)

This discussion is preserved as it was. New answers, comments, and votes are closed.