Advertisement
KashTheKingYT

Group Roles (UPDATED)

Jul 12th, 2022
9,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local groupId = 0 --Put your group id here
  2.  
  3. local players = game.Players
  4.  
  5.  
  6. function getRank(plr)
  7.  
  8.     local plrRank = plr:GetRankInGroup(groupId)
  9.  
  10.     local plrRole = plr:GetRoleInGroup(groupId)
  11.  
  12.     for i,team in pairs(game.Teams:GetChildren()) do
  13.  
  14.         local teamRank = team.Rank
  15.  
  16.         if plrRank == teamRank.Value then
  17.  
  18.             plr.Team = team
  19.  
  20.         end
  21.  
  22.     end
  23.  
  24.     print(plr.Name, plrRank, plrRole)
  25.  
  26. end
  27.  
  28.  
  29.  
  30. players.PlayerAdded:Connect(getRank)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement