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

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

Asked by 5 years ago

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

Log in to vote
0
Answered by
s_21 74
5 years ago

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.

Ad

Answer this question