Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService('Players')
- local Teams = game:GetService('Teams')
- local TeamTable = {
- enabled = true,
- linkedTeams = {
- {
- teamName = "Space Force",
- groupID = 9336129,
- minrank = 1
- },
- {
- teamName = "Space Special Operations Command",
- groupID = 9336214,
- minrank = 1
- },
- {
- teamName = "Space Training and Readiness Command",
- groupID = 9336191,
- minrank = 1
- },
- {
- teamName = "Space and Missile Systems Center",
- groupID = 9336214,
- },
- {
- teamName = "Space Operations Command",
- groupID = 9336214,
- minrank = 1
- },
- {
- teamName = "Space Security Forces",
- groupID = 9336129,
- minrank = 1
- },
- }
- }
- if TeamTable then
- Players.PlayerAdded:Connect(function(player)
- for i=1,#TeamTable.linkedTeams do
- local linkedTeam = TeamTable.linkedTeams[i]
- if player:IsInGroup(linkedTeam.groupID) then
- local canProceed = true
- if linkedTeam.minRank then if player:GetRankInGroup(linkedTeam.groupID) < linkedTeam.minRank then canProceed = false end end
- if linkedTeam.maxRank then if player:GetRankInGroup(linkedTeam.groupID) > linkedTeam.maxRank then canProceed = false end end
- if canProceed then
- if not linkedTeam.teamName then return end
- if Teams:FindFirstChild(linkedTeam.teamName) then player.Team = Teams:FindFirstChild(linkedTeam.teamName) end
- player:LoadCharacter()
- end
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement