Problem with ChatTag System

Hey,

I have an issue with my ChatTag System, and I would love some help if you don’t mind.


Issue

So basically, I made a button that fires a remote and changes the ChatTag,
the problem is, it changes the ChatTag for EVERY player in the server.


Code

--[[ SERVICES ]]--

local plrs = game:GetService("Players")
local sss = game:GetService("ServerScriptService")
local rs = game:GetService("ReplicatedStorage")

------------------------------------------------------------------------------------------------------------

--[[ VARIABLES ]]--

local events = rs:WaitForChild("Events")
local chatService = require(sss:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))

------------------------------------------------------------------------------------------------------------

--[[ CHAT TITLES ]]--

chatService.SpeakerAdded:Connect(function(player)
	local speaker = chatService:GetSpeaker(player)
	events:WaitForChild("EquipTitle").OnServerEvent:Connect(function(plr, title, titleColor)
		speaker:SetExtraData('NameColor', titleColor)
		speaker:SetExtraData('ChatColor', Color3.fromRGB(255,255,255))
		speaker:SetExtraData('Tags', {{TagText = title, TagColor = titleColor}})
	end)
end)

I appreciate any help!

First of all, nice job on organisation of code ^-^

Secondly, how are you firing* the event?

Lastly, please do some sanity checks inside the server script.

1 Like

Secondly, how are you during the event?

What do you mean by that?

Edit: oh nvm you edited it

firing* :sweat_smile: Autocorrect jumps in at the worst times

1 Like

I’m firing it from a button.

Here’s the code

Client Script
--[[ VARIABLES ]]--

local rs = game:GetService("ReplicatedStorage")
local events = rs:WaitForChild("Events")

------------------------------------------------------------------------------------------------------------

--[[ CALL REMOTE ]]--

script.Parent.MouseButton1Up:Connect(function()
	if script.Parent.Parent:WaitForChild("Selected Title").Value == "" then return end
	if script.Parent.Parent:WaitForChild("Selected Title").Value ~= "" then
		events:WaitForChild("EquipTitle"):FireServer("Beginner", Color3.fromRGB(255,255,255))
	end
end)