Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I have a team here, I want to be only on that team if I am in a group. Help?

So, in my game, I have multiple teams. I want the team to only be access-able through a group, So, let's say you're in the desired group. Alright, puts you on a the team with the group id in it. Not in the group? Puts you on a different team. Anyone know how to do this?

1 answer

✓ Accepted answer

Check the properties of the Team, Make sure 'Auto-Assignable' Is set to false (No tick in the box)

Then, Insert this script into ServerScriptSerivce or Workspace

local Id=2597152
game.Players.PlayerAdded:connect(function(Plr)
    if Plr:IsInGroup(Id) then
        Plr.TeamColor=BrickColor.new("Bright red")
end)

Change Id to the ID of you're groups ID. Change the 'Bright Red' to the team color of the team you want the players in that team to join.

This discussion is preserved as it was. New answers, comments, and votes are closed.