Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local groupService = game:GetService ("GroupService")
- local marketPlace = game:GetService ("MarketplaceService")
- local Services = {
- Players = game:GetService("Players");
- ReplicatedStorage = game:GetService("ReplicatedStorage");
- };
- local Settings = {
- GroupID = 4058321;
- CustomRanks = setmetatable({}, {__mode = "k"});
- CustomRankPrefix = {}
- };
- local CustomRankEvent = Instance.new("RemoteEvent", Services.ReplicatedStorage);
- CustomRankEvent.Name = "CustomRank";
- CustomRankEvent.OnServerEvent:Connect (function(player, rank)
- Settings.CustomRanks[player] = rank;
- pcall(function()
- local rank = player.Character.Head.PlayerInfo.Rank;
- if (not Settings.CustomRankPrefix[rank]) then
- Settings.CustomRankPrefix[rank] = rank.Text;
- end
- rank.Text = Settings.CustomRankPrefix[rank] .. Settings.CustomRanks[player];
- end);
- end);
- function getRoleInGroup (playerId, groupId)
- local groups = groupService:GetGroupsAsync (playerId);
- for i = 1, #groups do
- if (groups [i].Id == groupId) then
- return groups [i].Role, groups [i].Rank
- end;
- end;
- return "Guest", 0;
- end;
- function NewInstance(InstanceType, InstanceParent, InstanceName)
- local NInstance = Instance.new(InstanceType)
- NInstance.Parent = InstanceParent
- NInstance.Name = InstanceName
- return NInstance
- end
- Services.Players.PlayerAdded:connect(function(Player)
- Player.CharacterAdded:connect(function(Character)
- Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- if Player.Name == "hi" then return end
- local PlayerInfo = NewInstance("BillboardGui", Character.Head, "PlayerInfo")
- PlayerInfo.Size = UDim2.new(1, 0, 1, 0)
- PlayerInfo.StudsOffset = Vector3.new(-0.50, 2.5, 0)
- local PlayerName = NewInstance("TextLabel", PlayerInfo, "PlayerName")
- PlayerName.Text = Character.Name
- PlayerName.Size = UDim2.new(2, 0, 1, 0)
- PlayerName.Position = UDim2.new(0, 0, 0, 15)
- PlayerName.BackgroundTransparency = 1
- PlayerName.Font = Enum.Font.SourceSansBold
- PlayerName.FontSize = Enum.FontSize.Size24
- PlayerName.TextColor3 = Color3.fromRGB(255, 255, 255)
- local Rank = NewInstance("TextLabel", PlayerInfo, "Rank")
- local RoleInGroup, RankInGroup = getRoleInGroup (Player.UserId, Settings.GroupID);
- if RoleInGroup ~= "Guest" then
- Rank.Text = RoleInGroup
- if RankInGroup >=14 then
- PlayerName.TextColor3 = Color3.fromRGB(232, 202, 120)
- end
- else
- Rank.Text = "Customer"
- end
- if (marketPlace:UserOwnsGamePassAsync (Player.UserId, 5379596)) then
- Rank.Text = Rank.Text .. " [PRIORITY]"
- end
- if (Settings.CustomRanks[Player]) then
- Rank.Text = Rank.Text .. Settings.CustomRanks[Player];
- end;
- Rank.Size = UDim2.new(2, 0, 1, 0)
- Rank.Position = UDim2.new(0, 0, 0, 35)
- Rank.BackgroundTransparency = 1
- Rank.Font = Enum.Font.SourceSansItalic
- Rank.FontSize = Enum.FontSize.Size18
- Rank.TextColor3 = Color3.new(255, 255, 255)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement