I Can't Send System Messages to Chat

So, im trying to make System send messages.I’ve tried everything but it’s not working.
The error is, i can’t get TextChannels.
script:

local function generateSystemMsg(MsgDict: array)
    return '<font color="#'..MsgDict["Color"]..'"><font size="'..MsgDict["FontSize"]..'"><font face="'..MsgDict["Font"]..'">'..MsgDict["Text"]..'</font></font><font/>'
end

local Choices = {
                "5";
		"4";
		"3";
		"2";
		"1"	
}

while true do
	local randomTip = math.random(1, #Choices)
	local pickedTip = Choices[randomTip]
	
	local chat = game:GetService("TextChatService")
	local channel = chat:WaitForChild("TextChannels"):WaitForChild("RBXSystem")
	
	channel:DisplaySystemMessage(
		generateSystemMsg({
		    Text = "[SYSTEM] "..tostring(pickedTip);
			Font = "Gotham";
			Color = Color3.fromRGB(255, 0, 0):ToHex();
			FontSize = "17";
		})
	)
	task.wait(1)	
end

and error is:
Infinite yield possible on ‘TextChatService:WaitForChild(“TextChannels”)’

can someone please help me?

1 Like

It has probably has to do with the new Text chat services.

if youre getting an Infinite yield then obviously it cant find “TextChannels”, this hwoerer isnt your fault, its probably the new chat services, like @coolboymc17 said.

oh ok thanks to y’all i’ve solved

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.