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

How do I make the team be created when someone from the group joins?

Asked by 9 years ago

I want it so when someone in a specific group joins, a new team is created and they will be in that group. I have this so far, but whenever more than one person joins, it makes multiple copies of the same team.

function onPlayerEntered(plyr)
if plyr:IsInGroup(1094909) then
    sss = Instance.new("Team")
    sss.Parent = game.Teams
    sss.Name = "Swedish Security Service"
    sss.TeamColor = BrickColor.new("Navy blue")
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)

Answer this question