It has partner but this is a example. It needs to be the default name, but the tag is added to a group with certain ranks, the ranks are: 200, 201, 203, 212, 214, 215 and 255.
You can easily make the script yourself. All you are doing is checking if the Player was added using game.Players.PlayerAdded and then checking if the PlayersCharacter was added using Player.CharacterAdded, then just getting the Data, and applying it with the info I gave.
function addtag(Rank, tag)
local player = game.Players.localPlayer
local rank = player:GetRankInGroup(1111111) -- fake
if rank == Rank then
player.DisplayName = "("..tag..")"
end
end
addtag(255, "staff")
It’s a good start but as the previous person said, you need to check when the player was added and check when their character was added. You also need to make this a Script and not a LocalScript, as it will not replicate to the server if it’s done on the client.
As for the ranks, I recommend you create a table with each rank’s numbers and their given name. Here’s an example:
local Ranks = {[1] = "Member", [255] = "Owner"}
Below is an idea of what your final script should look like!
local GroupID = 1111111 --The group's ID.
local Ranks = {[1] = "Member", [255] = "Owner"} --Table with stored rank numbers and their given names.
local function AddTag(Player) --Add tag function.
local Rank = Player:GetRankInGroup(GroupID)
if Ranks[Rank] then --Checks our Ranks table to see there is a custom name for the player's rank number.
Player.Character:WaitForChild("Humanoid").DisplayName = Ranks[Rank] --Waits for the player's Humanoid to load so we can set it's display name to the rank.
end
end
game.Players.PlayerAdded:Connect(function(Player) --Connection that fires when a player joins.
Player.CharacterAdded:Connect(function(Character) --An event that activates every time the player's character has been added.
AddTag(Player) --Adds the tag to the given player.
end)
end)