Event:FireAllClients() not working on the client end

I have a problem with code yielding, where there are two variables which yield the event and I don’t know to go about it since I need those 2 variables, the code works perfectly fine if the 2 variables are not there.

Situation 1

local TextChannels = Services.TextChatService:WaitForChild("TextChannels")
local RBXGeneral = Services.TextChatService:WaitForChild("RBXGeneral")

local function LoadMessage(Message)
	print(Message)
end

Events.SendChatMessages.OnClientEvent:Connect(LoadMessage)

Event won’t register

Situation 2

-- local TextChannels = Services.TextChatService:WaitForChild("TextChannels")
-- local RBXGeneral = Services.TextChatService:WaitForChild("RBXGeneral")

local function LoadMessage(Message)
	print(Message)
end

Events.SendChatMessages.OnClientEvent:Connect(LoadMessage)

Work’s perfectly fine, but as you I see, I need those 2 variables to display a message on the chat.

image

Do you get any infinite yield possible errors?

1 Like

Nope, none that relate to the script.
Okay yeah there did appear a warning.

Nevermind I figured what the issue was, tried looking for the rbx general on the service instead of the folder.

local TextChannels = Services.TextChatService:WaitForChild(“TextChannels”)
local RBXGeneral = Services.TextChatService:WaitForChild(“RBXGeneral”) :: TextChannel