Hello everyone, so I was making a Team Script, that adds people in a list to a certain team in-game. But it doesnt work, I was wondering if someone could help me.
Thx
Heres the script:
Hello everyone, so I was making a Team Script, that adds people in a list to a certain team in-game. But it doesnt work, I was wondering if someone could help me.
Thx
Heres the script:
Can I see the error? I need to understand what is going wrong with the script.
You need the id for best results.
Hello Showy19!
I think the key you are looking for is table.find.
local allowedplayers = {
"arccitecc",
"Showy19"
}
game.Players.PlayerAdded:Connect(function(player)
if table.find(allowedplayers,player.Name) then
player.Team = game.Teams.Police
else
player.Team = game.Teams.EMS
end
end)