Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. teamRemote.OnServerEvent:Connect(function(player, teamName)
  2.     for i,v in pairs(teamRequirement:GetChildren()) do
  3.         if v.Name == teamName then
  4.             print(teamName)
  5.             if v:FindFirstChild('GamepassID') then
  6.                 if market.UserOwnsGamePassAsync(player.UserId, v:FindFirstChild('GamepassID').Value) then
  7.                     giveTeam(player, teamName)
  8.                     return true
  9.                 else
  10.                     market:PromptGamePassPurchase(player, v:FindFirstChild('GamepassID').Value)
  11.                     return false
  12.                 end
  13.             end
  14.            
  15.             if v:FindFirstChild('GroupID') then
  16.                 local groupID = v:FindFirstChild('GroupID').Value
  17.                 print(groupID)
  18.                
  19.                 if player:IsInGroup(v:FindFirstChild('GroupID').Value) then
  20.                     if v:FindFirstChild('RankID') then
  21.                         local rankID = tonumber(v:FindFirstChild('RankID').Value)
  22.                         print(rankID)
  23.                        
  24.                         if player:GetRankInGroup(groupID) >= rankID then
  25.                             if v:FindFirstChild('cantJoinID') then
  26.                                 local cantID = tonumber(v:FindFirstChild('cantJoinID').Value)
  27.                                 print(cantID)
  28.                                 if player:GetRankInGroup(groupID) >= cantID then
  29.                                     giveTeam(player, teamName)
  30.                                     return true
  31.                                 else
  32.                                     giveTeam(player, teamName)
  33.                                 end
  34.                             end                            
  35.                            
  36.                         end
  37.                     else
  38.                         giveTeam(player, teamName)
  39.                     end
  40.                 end
  41.                 return false
  42.             end
  43.            
  44.             giveTeam(player, teamName)
  45.         end
  46.     end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement