Infinite yield while looking for ChatServiceRunner?

I’m trying to make a VIP chat tag, and to do so I need to require ChatService. I have no clue why I’m getting this yield?

script:

local gamepassId = script.GamepassID.Value
local service = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player)
	if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
		local tags = {
			{
				TagText = "VIP",
				TagColor = Color3.fromRGB(255, 255, 0)
			}
		}
		local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
		local speaker = nil
		while speaker == nil do
			speaker = ChatService:GetSpeaker(player.Name)
			if speaker ~= nil then break end
			task.wait(.01)
		end
		speaker:SetExtraData("Tags",tags)
		speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end
end)

Are you using a new version of chat or an old one? Because in the new chat it is different.
If you are using the new version, ChatServiceRunner does not exist (maybe , I don’t know, but I found this error when I switched to the new version of chat. I had to rewrite all the scripts that created the nametag. )

As @BroOfNoob mentioned, I assume the ChatServiceRunner module had been deprecated and replaced by another chat system. The newer system is called TextChatService. Here’s a link to the developer hub if you’re interested:

3 Likes