Is there any way for me to remove chat tags? I am using SetExtraData
Why would you want to remove chat tags?
As an option in a menu (30 chars)
That’s not really a good idea because people would do that purposely just to say mean things.
What do you mean? I want the player to be able to toggle the chat tag
Wait… Ohhh! I thought you meant safety chat
Oh, i want that to be in the game
Oh ok, alright
30 charssssssss
Do you know how I could do this?
I’m confused what do you mean by chat tag? I’m kinda dumb.
Oh you meant the tags for the speaker lol.
You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
- What is the issue? Include screenshots / videos if possible!
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
You have only answered question one.
Please provide some code and answer some of the other questions, it’s hard for us to help if most people don’t even know what you need help with.
Ok, so I have a button that fires a remote event to give the player a chat tag. I also want a way to get rid of the chat tag. I am using SetExtraData to give the chat tag.
Code:
game.ReplicatedStorage.TagVIP.OnServerEvent:Connect(function(player)
local tags = { -- table for tags
{ -- first tag
TagText = "đź‘‘VIPđź‘‘", -- Tag text
TagColor = Color3.fromRGB(255, 215, 0) -- TagColor
}
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService) -- Get chat service
-- Get speaker
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) -- Set tags
speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 215, 0)) -- Change chat color, and dont use BrickColor.new(...).Color
end)
You can remove a player’s tag simply by using :SetExtraData(“Tags”) but with no extra arguments.
Rough example:
speaker:SetExtraData("Tags", tags) -- Gives the player a tag
speaker:SetExtraData("Tags") -- Removes all tags on the player
That did not seem to work. (30 chars)
Could you post the code on how you did it? I tested it myself and it should remove the tag.
Set the value to nil with a remote event button
I tried setting it to nil
and it changed the tag to [???]
It didn’t work because it wasn’t the right Remote Event
in the function