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)
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
Unfortunately, one of my dev deleted the system on accident sorry!
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?
Im currently using the old chat
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)
Oh can i get some code examples because i want to learn to code it soon
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.
I just realised out that my pc wasnt with me but i will replied u back when i got it back
But luckly i seems to have the code on my phone ima check ky clipboard
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
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
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)
Hmm it quiet interesting i might dig for more info on this thanks for ur help!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.