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?