Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. local groupService = game:GetService ("GroupService")
  2. local marketPlace = game:GetService ("MarketplaceService")
  3. local Services = {
  4. Players = game:GetService("Players");
  5. ReplicatedStorage = game:GetService("ReplicatedStorage");
  6. };
  7. local Settings = {
  8. GroupID = 4058321;
  9. CustomRanks = setmetatable({}, {__mode = "k"});
  10. CustomRankPrefix = {}
  11. };
  12.  
  13. local CustomRankEvent = Instance.new("RemoteEvent", Services.ReplicatedStorage);
  14. CustomRankEvent.Name = "CustomRank";
  15. CustomRankEvent.OnServerEvent:Connect (function(player, rank)
  16. Settings.CustomRanks[player] = rank;
  17.  
  18. pcall(function()
  19. local rank = player.Character.Head.PlayerInfo.Rank;
  20. if (not Settings.CustomRankPrefix[rank]) then
  21. Settings.CustomRankPrefix[rank] = rank.Text;
  22. end
  23. rank.Text = Settings.CustomRankPrefix[rank] .. Settings.CustomRanks[player];
  24. end);
  25. end);
  26.  
  27. function getRoleInGroup (playerId, groupId)
  28. local groups = groupService:GetGroupsAsync (playerId);
  29.  
  30. for i = 1, #groups do
  31. if (groups [i].Id == groupId) then
  32. return groups [i].Role, groups [i].Rank
  33. end;
  34. end;
  35.  
  36. return "Guest", 0;
  37. end;
  38.  
  39. function NewInstance(InstanceType, InstanceParent, InstanceName)
  40. local NInstance = Instance.new(InstanceType)
  41. NInstance.Parent = InstanceParent
  42. NInstance.Name = InstanceName
  43. return NInstance
  44. end
  45.  
  46. Services.Players.PlayerAdded:connect(function(Player)
  47. Player.CharacterAdded:connect(function(Character)
  48. Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  49.  
  50. if Player.Name == "hi" then return end
  51.  
  52. local PlayerInfo = NewInstance("BillboardGui", Character.Head, "PlayerInfo")
  53. PlayerInfo.Size = UDim2.new(1, 0, 1, 0)
  54. PlayerInfo.StudsOffset = Vector3.new(-0.50, 2.5, 0)
  55. local PlayerName = NewInstance("TextLabel", PlayerInfo, "PlayerName")
  56. PlayerName.Text = Character.Name
  57. PlayerName.Size = UDim2.new(2, 0, 1, 0)
  58. PlayerName.Position = UDim2.new(0, 0, 0, 15)
  59. PlayerName.BackgroundTransparency = 1
  60. PlayerName.Font = Enum.Font.SourceSansBold
  61. PlayerName.FontSize = Enum.FontSize.Size24
  62. PlayerName.TextColor3 = Color3.fromRGB(255, 255, 255)
  63. local Rank = NewInstance("TextLabel", PlayerInfo, "Rank")
  64. local RoleInGroup, RankInGroup = getRoleInGroup (Player.UserId, Settings.GroupID);
  65. if RoleInGroup ~= "Guest" then
  66. Rank.Text = RoleInGroup
  67. if RankInGroup >=14 then
  68. PlayerName.TextColor3 = Color3.fromRGB(232, 202, 120)
  69. end
  70. else
  71. Rank.Text = "Customer"
  72. end
  73. if (marketPlace:UserOwnsGamePassAsync (Player.UserId, 5379596)) then
  74. Rank.Text = Rank.Text .. " [PRIORITY]"
  75. end
  76. if (Settings.CustomRanks[Player]) then
  77. Rank.Text = Rank.Text .. Settings.CustomRanks[Player];
  78. end;
  79. Rank.Size = UDim2.new(2, 0, 1, 0)
  80. Rank.Position = UDim2.new(0, 0, 0, 35)
  81. Rank.BackgroundTransparency = 1
  82. Rank.Font = Enum.Font.SourceSansItalic
  83. Rank.FontSize = Enum.FontSize.Size18
  84. Rank.TextColor3 = Color3.new(255, 255, 255)
  85. end)
  86. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement