Advertisement
KashTheKingYT

Group Ranks

Jul 24th, 2021
2,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. local groupId = 6420058
  2. local players = game.Players
  3.  
  4. function getRank(plr)
  5.     local plrRank = plr:GetRankInGroup(groupId)
  6.     local plrRole = plr:GetRoleInGroup(groupId)
  7.    
  8.     for i,team in pairs(game.Teams:GetChildren()) do
  9.         local teamRank = team.Rank
  10.         if plrRank == team.Rank.Value then
  11.             plr.Team = team
  12.         end
  13.     end
  14.    
  15.     print(plr.Name, plrRank, plrRole)
  16. end
  17.  
  18. players.PlayerAdded:Connect(getRank)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement