Any help with chat tag

can any one help me please i cant fix this script its make a chat tag for the VIP gamepass and group members

CODE :

local gamepassId = 213679695
local service = game:GetService(“MarketplaceService”)
local rank = 100 – The rank the player will need to get through (out of 255)
local groupID = 7023447 – The group ID the player must be in

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

if player:IsInGroup(groupID) and player:GetRankInGroup(groupID) >= rank then
	local tags = {
		{
			TagText = player:GetRoleInGroup(groupID),
			TagColor = Color3.fromRGB(255, 172, 7)
		}
	}
	local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
	local speaker = nil
	while speaker == nil do
		speaker = ChatService:GetSpeaker(player.Name)
		if speaker ~= nil then break end
		wait(0.01)
	end
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 172, 7))

else

	if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
		local tags = {
			{
				TagText = " VIP ",
				TagColor = Color3.fromRGB(255, 172, 7)
			}
		}
		local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
		local speaker = nil
		while speaker == nil do
			speaker = ChatService:GetSpeaker(player.Name)
			if speaker ~= nil then break end
			wait(0.01)
		end
		speaker:SetExtraData("Tags",tags)
		speaker:SetExtraData("ChatColor",Color3.fromRGB(226, 226, 0))
	end	
end

end)

2 Likes
game.Players.PlayerAdded:Connect(function(player)
			local tags = {
				{
					TagText = " VIP ",
					TagColor = Color3.fromRGB(255, 172, 7)
				}
			}
			local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
			local speaker = nil
			while speaker == nil do
				speaker = ChatService:GetSpeaker(player.Name)
				if speaker ~= nil then break end
				wait(0.01)
			end
			speaker:SetExtraData("Tags",tags)
			speaker:SetExtraData("ChatColor",Color3.fromRGB(226, 226, 0))
end)

Try that, if it works, add your gamepass ID and group ID with the statements needed.

2 Likes

thx for the reply but its not work too .i copy the code from my other game its work with the other but not with this

for me it worked. a bit weird.

image
it worked for me

1 Like

yes if you copy the code and replace group id with yours its will work in your game but its not work with me, i think its for the new chat model.

its for both. lemme try the new model

robloxapp-20230727-0044010.wmv (380.4 KB)

wait.
image
it works for old model

test chat video
robloxapp-20230727-0044010.wmv (380.4 KB)

do you know how to make it on the back model

1 Like

yes
go to textchatservice > chatversion > legacychatservice

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.