Advertisement
Guest User

Group roles for players.

a guest
Sep 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. local playerStats = {} --this keeps a list of the stats for each player that enters the game
  2.  
  3. game.Players.PlayerAdded:connect(function(player)
  4. local leaderstats = Instance.new("Model", player)
  5. leaderstats.Name = "leaderstats"
  6.  
  7. local grouprank = Instance.new("StringValue", leaderstats)
  8. grouprank.Name = "Rank"
  9. local rank = player:GetRoleInGroup(5097985) -- Insert the group ID for whatever group you want ranks displayed for here.
  10.  
  11. if rank ~= 0 then
  12. grouprank.Value = rank
  13. else
  14. grouprank.Value = "Outsider"
  15. end
  16.  
  17. playerStats[player] = leaderstats
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement