Group Auto Team Assigner Not Working

I am trying to make a group locked Auto Team Assigner.
I have tried this but it did not work. Why is it not working?
I have auto assignable off, and the neutral off, and the Team and the Spawn Colors match.

function onPlayerEntered(plr)

if plr:IsInGroup(4907341) then

plr.TeamColor = BrickColor.new("Baby blue")

plr:LoadCharacter()

end

end

game.Players.PlayerAdded:connect(onPlayerEntered)

Try setting player.Team
To the actual team.

plr.Team = game:GetService([[Teams]])[NameOfTeam]--Team path

If that does not work, check that IsInGroup if statement is working by adding a print

What this would look like:

function onPlayerEntered(plr)
    print(plr)
    if plr:IsInGroup(4907341) then
        print(4907341)
        plr.Team = game:GetService([[Teams]])[NameOfTeam]--Team path
        plr:LoadCharacter()
    end

end

game.Players.PlayerAdded:connect(onPlayerEntered)

Extra Note: Make sure Teams is inserted.

3 Likes

Good question, why isn’t it working? There’s no issues with the script itself. I threw this in Roblox Studio (or rather created a lazy version of it) and it worked as expected.

TeamScriptRepro.rbxl (14.8 KB)

Is there some kind of discrepancy between my repro and your current place file? Perhaps something missing? The script is clearly not the issue.

I believe the Teams Service was not added. If that was not the case, I have no clue.