How to make a chat nametag to who have a certain rank in my group?

What do you want to achieve?
So I’m trying to make a chat nametag that is given to the members of this group: Project: New Edition - Roblox (ID: 16438390), who has a certain rank.

What is the issue?
I don’t know how I could do that.

What solutions have you tried so far?
I searched both for chat nametag and group rank but I have no idea how I could do that.

Thanks for reading and probably helping, have a great day and happy developing!!

game.Players.PlayerAdded:Connect(function(player)
	
	local GROUP_ID = 16438390 --Your group ID.
	
	if player:GetRankInGroup(GROUP_ID) == 255 then
		
		--Give owner name tag.
		
	else
		
		--Player is not the owner.
		
	end
end)
2 Likes

I will try that, thanks! It’s already nice, now I think I’ll be able to do what I want but anyways do you know how to add the nametag part?

Sure, give me a few minutes. [Can’t get on roblox studio because roblox is down.]

2 Likes

If you have any questions make sure to ask. If I helped you make sure to mark this as a solution!

local function CREATE_CHAT_TAG(player, name, color)
	
	local CS = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
	
	local Speaker = CS:GetSpeaker(player.Name)		
	Speaker:SetExtraData("Tags", {{TagText = name, TagColor = color}})
	
end

game.Players.PlayerAdded:Connect(function(player)

	local GROUP_ID = 16438390 --Your group ID.
	
	local RANK = player:GetRoleInGroup(GROUP_ID)
	
	CREATE_CHAT_TAG(player, RANK, Color3.new(1, 0.235294, 0.247059))
	
end)
2 Likes

And where do I write what I want to be the chat nametag?

This gets your group rank name.

1 Like

Ok, so I will try that. I tell you if it don’t work and if it work I’ll mark your post as the solution!

Sorry for the late response, I tried the script in Studio and it doesn’t work, I don’t get the chat nametag. I’m using the old chat service, is that why?

Could you send me the error you get?

1 Like

Oh sorry I forgot to check… I will check that as soon as possible!

Sorry for the very late answer, I’ve checked and I found no errors… Where should I see them?

Output that where you see errors