Hi developers,
My game has chat tag system. And I want to make VIP chat tag game-pass. If they own game-pass, they will get VIP chat tag. Problem is, I want to give an additional VIP chat tag without deleting the existing chat tag, but I don’t know how to do that.
Thank you in advance!
My chat system:
local players = game:GetService("Players")
local serverScriptService = game:GetService("ServerScriptService")
local chatService = require(serverScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local GlobalLeaderboard = game.Workspace:WaitForChild("RebirthGlobalLeaderboard")
local Rebirth_itemsFolder = GlobalLeaderboard:WaitForChild("SurfaceGui"):WaitForChild("Frame"):WaitForChild("Contents"):WaitForChild("Items")
chatService.SpeakerAdded:Connect(function(player)
while task.wait(5) do
local speaker = chatService:GetSpeaker(player)
if players[player]:IsInGroup(6589440) and players[player]:GetRoleInGroup(6589440) ~= "Fan" then
if players[player]:GetRoleInGroup(6589440) == "Main Developer" then
speaker:SetExtraData("Tags", {{TagText = "DEV", TagColor = Color3.fromRGB(255,238,0)}})
else
if players[player]:GetRoleInGroup(6589440) == "Influencer" then
speaker:SetExtraData("Tags", {{TagText = "⭐ YouTuber", TagColor = Color3.fromRGB(255, 51, 51)}})
else
speaker:SetExtraData("Tags", {{TagText = "🛠️" .. players[player]:GetRoleInGroup(6589440), TagColor = Color3.fromRGB(255, 149, 232)}})
end
end
else
if Rebirth_itemsFolder:FindFirstChild(players[player].Name) then
local SpeakerItemFolder = Rebirth_itemsFolder:FindFirstChild(players[player].Name)
if SpeakerItemFolder.Values.Number.Text == "1" then
speaker:SetExtraData("Tags", {{TagText = "🏆#1", TagColor = Color3.fromRGB(255, 213, 0)}})
task.wait()
else
if Rebirth_itemsFolder:FindFirstChild(players[player].Name) then
local SpeakerItemFolder = Rebirth_itemsFolder:FindFirstChild(players[player].Name)
if SpeakerItemFolder.Values.Number.Text == "2" then
speaker:SetExtraData("Tags", {{TagText = "🏆#2", TagColor = Color3.fromRGB(212, 212, 212)}})
task.wait()
else
if Rebirth_itemsFolder:FindFirstChild(players[player].Name) then
local SpeakerItemFolder = Rebirth_itemsFolder:FindFirstChild(players[player].Name)
if SpeakerItemFolder.Values.Number.Text == "3" then
speaker:SetExtraData("Tags", {{TagText = "🏆#3", TagColor = Color3.fromRGB(255, 89, 0)}})
task.wait()
else
if Rebirth_itemsFolder:FindFirstChild(players[player].Name) then
local SpeakerItemFolder = Rebirth_itemsFolder:FindFirstChild(players[player].Name)
if SpeakerItemFolder.Values.Number.Text ~= "1" or SpeakerItemFolder.Values.Number.Text ~= "2" or SpeakerItemFolder.Values.Number.Text ~= "3" then
speaker:SetExtraData("Tags", {{TagText = "🌏#" .. SpeakerItemFolder.Values.Number.Text, TagColor = Color3.fromRGB(0, 255, 238)}})
task.wait()
else
speaker:SetExtraData("Tags")
print("-- rankchat: Player Removed on leaderboard.")
end
end
end
end
end
end
end
end
end
end
task.wait(10)
end)