Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How i change player's team on textbutton click? [closed]

Asked by 4 years ago
Edited 4 years ago

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

0
more info plxs, what's your hierarchy? what is Team supposed to be? a folder? Fifkee 2017 — 4y

Closed as Non-Descriptive by Fifkee and User#29913

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
IcyMizu 122
4 years ago
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 :)

Ad