Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] I am trying to add tags into chat. What am I doing wrong?

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
print(ChatService) -- No print

local owners = {QuikSilver09 = true, flameman0987 = true}
local devs = {ThetaBird = true, dogbrainxd = true}
print("2 tbls") -- Prints fine

local ownerTag = {TagText = "OWNER", TagColor = Color3.fromRGB(42, 145, 255)}
local VIPTag = {TagText = "VIP", TagColor = Color3.fromRGB(255, 206, 7)}
local FANTag = {TagText = "Fan", TagColor = Color3.fromRGB(43, 255, 43)}
print("5 tbls") -- Prints fine

game:GetService("Players").PlayerAdded:Connect(function(player)
	print("player JOINED") -- No print
	
	if owners[player.Name] then
		print("line")
		local speaker = ChatService:GetSpeaker(player.Name)
		speaker:SetExtraData("Tags", ownerTag)
	elseif player:WaitForChild("Gamepasses"):WaitForChild("VIP").Value then
		local speaker = ChatService:GetSpeaker(player.Name)
		speaker:SetExtraData("Tags", VIPTag)
	elseif player:IsInGroup(4515569) then
		local speaker = ChatService:GetSpeaker(player.Name)
		speaker:SetExtraData("Tags", FANTag)
	end
end)

I believe the issue is this line local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

I have commented it out and my PlayerAdded function runs just fine. I just do not know what to do considering I am getting no errors. Any help would be great, thanks.

2 comments

0

i think you havent ended the require yet, has no ) in it

0

I did it just got cut. Player was loading before chat service that was the issue

1 answer

✓ Accepted answer

i think you havent ended the require yet, has no ) in it

This discussion is preserved as it was. New answers, comments, and votes are closed.