Multiple chat tag for players

I currently working on a game that need chat tag to know who is an admin or owner or a dev but i alelso have a vip gamepass and a group and i also need chat tag for them, but my system i used currently only support 1 tag and i have watch lots of YouTube vids and devforum but havent find an answer, i hope u guys can help me with this (im currently new to scripting in roblox)

3 Likes

Can you please send the code you are using for your current system? That way, we can base our suggestions on how to get the desired outcome on your existing code

1 Like

Unfortunately, one of my dev deleted the system on accident sorry!

2 Likes

I can guide you along the process of recovering it if you want? If not, I can try to help you - but I’m only familiar with one of the chat systems (the legacy version). Are you using the old one or the new one?

1 Like

Im currently using the old chat

1 Like

The old chat system lets you add multiple quite easily.
In the SetExtraData thing, it takes an array of the chat tags (so you may have had to add 2 sets of {}). By adding more of the chat tag things into that array, you can have multiple chat tags at once

(its night so I’m not sure if this message is overly clear)

1 Like

Oh can i get some code examples because i want to learn to code it soon

1 Like

It may be a bit easier if I just modify your existing code (that was deleted). I’ll comment what I do so its easier for you to understand. As its late at night I probs can’t make anything good from scratch

To recover old versions of hte game, go to studio → File → Game Settings → Places then select the place → 3 dots → Version History. You can then navigate to an old version of the game and access them.

2 Likes

I just realised out that my pc wasnt with me but i will replied u back when i got it back

2 Likes

But luckly i seems to have the code on my phone ima check ky clipboard

1 Like

All good! I may not be able to respond when you end up getting your PC cause its already night time for me, but i’ll have a look at it when I get back.

In the mean time, here are a couple of similar posts that may provide further information

1 Like

Seems like i found the script i used

local ServerScriptService = game:GetService("ServerScriptService")

local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Players = game:GetService("Players")
local TagOwners = {"YourMAINRobloxUsername", "SomeoneelsesRobloxUsername",}  -- Change "YourMAINRobloxUsername and SomeoneelsesRobloxUsername"to who ever you want to have this ChatTag
local customRoleText = "CustomRoleText"  -- Change YourChatTagText to what you want your role to be.
local TagColor = Color3.fromRGB(0, 170, 255) -- Change this to whatever color you want your tags to be.

ChatService.SpeakerAdded:Connect(function(PlrName)
    local Speaker = ChatService:GetSpeaker(PlrName)
    if table.find(TagOwners, PlrName) then
        Speaker:SetExtraData('Tags', {{TagText = customRoleText, TagColor = TagColor }})
    end
end)```
--Its for the legacy chat btw
1 Like

This is the basic premise of adding multiple:

local ServerScriptService = game:GetService("ServerScriptService")

local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Players = game:GetService("Players")
local TagOwners = {"YourMAINRobloxUsername", "SomeoneelsesRobloxUsername",}  -- Change "YourMAINRobloxUsername and SomeoneelsesRobloxUsername"to who ever you want to have this ChatTag
local customRoleText = "CustomRoleText"  -- Change YourChatTagText to what you want your role to be.
local TagColor = Color3.fromRGB(0, 170, 255) -- Change this to whatever color you want your tags to be.

local VIPPlayers = {"PoppyandNeivaarecute", "Dang9535"}
local VIPText = "VIP"
local VIPColor = Color3.new(1, 0. 1)

ChatService.SpeakerAdded:Connect(function(PlrName)
    local Speaker = ChatService:GetSpeaker(PlrName) 
    local Tags = {}
    if table.find(TagOwners, PlrName) then
       table.insert(Tags, {TagText = customRoleText, TagColor = TagColor }) -- Add the relevant tag to the Tags array
    end
    if table.find(VIPPlayers, PlrName then -- Ensure that it is if, not elseif or else if
        table.insert(Tags, {TagText = VIPText, TagColor = VIPColor})
    end
    Speaker:SetExtraData('Tags', Tags) -- Add all the applicable tags 
end)

Is there anyway to make the vip using on gamepass and maybe for group too?

Also i want to get multiple chat tag like this image right here

open me

Sorry for not telling u earlier

you would use

local MPS = game:GetService("MarketplaceService")

if MPS:UserOwnsGamepassAsync(plr.UserId, GamepassID) then
    table.insert(...

and

if plr:GetRankInGroup(GroupID) >= 1 then
    table.insert(...

to achieve what you want!

(also dw, that’s what I assumed you wanted)

1 Like

Hmm it quiet interesting i might dig for more info on this thanks for ur help!

1 Like

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