Advertisement
LawMixer

Nothing

Apr 7th, 2021
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local Players = game:GetService('Players')
  2. local Teams = game:GetService('Teams')
  3.  
  4. local TeamTable = {
  5.     enabled = true,
  6.     linkedTeams = {
  7.         {
  8.             teamName = "Space Force",
  9.             groupID = 9336129,
  10.         },
  11.         {
  12.             teamName = "Space Special Operations Command",
  13.             groupID = 9336214,
  14.         },
  15.         {
  16.             teamName = "Space Training and Readiness Command",
  17.             groupID = 9336191,
  18.         },
  19.         {
  20.             teamName = "Space and Missile Systems Center",
  21.             groupID = 9336214,
  22.         },
  23.         {
  24.             teamName = "Space Operations Command",
  25.             groupID = 9336214,
  26.         },
  27.         {
  28.             teamName = "Space Security Forces",
  29.             groupID = 9336129,
  30.         },
  31.     }
  32. }
  33.  
  34. if TeamTable then
  35.     Players.PlayerAdded:Connect(function(player)
  36.         for i=1,#TeamTable.linkedTeams do
  37.             local linkedTeam = TeamTable.linkedTeams[i]
  38.             if player:IsInGroup(linkedTeam.groupID) then
  39.                 local canProceed = true
  40.                
  41.                 if linkedTeam.minRank then if player:GetRankInGroup(linkedTeam.groupID) < linkedTeam.minRank then canProceed = false end end
  42.                 if linkedTeam.maxRank then if player:GetRankInGroup(linkedTeam.groupID) > linkedTeam.maxRank then canProceed = false end end
  43.                
  44.                 if canProceed then
  45.                     if not linkedTeam.teamName then return end
  46.                    
  47.                     if Teams:FindFirstChild(linkedTeam.teamName) then player.Team = Teams:FindFirstChild(linkedTeam.teamName)
  48.                    
  49.                     player:LoadCharacter()
  50.                 end
  51.             end
  52.             end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement