How to make this team only for selected players

player = script.Parent.Parent.Parent.Parent

team = game.Teams[“Special Team”]

function onButtonClicked()

player.TeamColor = team.TeamColor

end

script.Parent.MouseButton1Down:connect(onButtonClicked)

How would I make this into a selected user team without using group roles and only usernames?

By using a table,
Example: users = {"name";"name"}

1 Like

Alright ill try that, thanks for responding.

1 Like

Im not good at scripting and I tried a lot with the table you said, but nothing I tried work could you explain it?

local WhitelistedUsers = {'Username1'}

local player = script.Parent.Parent.Parent.Parent

local team = game.Teams[“Special Team”]

function onButtonClicked()
if table.find(WhitelistedUsers, player.Name) then
   player.TeamColor = team.TeamColor
end
end

script.Parent.MouseButton1Down:connect(onButtonClicked)
2 Likes

Alright thank you so much for this.

1 Like