System chat wont show anything

So what I’m trying to do is to make a way to quickly send messages to the chat using a RemoteEvent. But when sending anything to the remote it won’t send anything.

The server side script works but it seems to be the local script that is having trouble

-- SERVER SCRIPT

ClientChat:FireClient(player,"Saving "..string.len(HTTPService:JSONEncode(saveList))) 

-- LOCAL SCRIPT

local ClientChat = game.ReplicatedStorage:WaitForChild("ClientChat")

--Get the StarterGui service
local StarterGui = game:GetService("StarterGui")

--Use a repeat to make sure we get our system message
--The repeat will only stop once the function successfully runs
ClientChat.OnClientEvent:Connect(function(msg)
	--if c == nil then c = Color3.fromRGB(0,255,255) end
	print(msg)
	
		--Run SetCore method inside the pcall
		--The first argument of SetCore is the method we wish to use
		--In this case, the second argument is a dictionary of data for the chat message
	repeat
		wait() --Wait to prevent crashing
		local Success,err = pcall(function()
			--Run SetCore method inside the pcall
			--The first argument of SetCore is the method we wish to use
			--In this case, the second argument is a dictionary of data for the chat message
			StarterGui:SetCore("ChatMakeSystemMessage", {
				["Text"] = "[ADMIN] "..msg; --The chat message
				["Color"] = Color3.fromRGB(255, 255, 255); --Chat message color, defaults to white
				["Font"] = Enum.Font.SourceSansBold; --Chat message font, defaults to SourceSansBold
			})
		end)
		
		if not Success then
			print(err)
		end
	until Success
end)

I’ve never seen this done this way. Anyways, what is the output of the prints? If there is no output coming from them then it’s because the server isn’t firing the event which means the issue comes from the server. If it is printing, then what is it printing and what does it say the error is in the pcall?

1 Like

There is no error while im still firing the event any other way to do this

image

Mb i didn’t see that he showed it

I’ve answered two similar question yesterday. We still have to get used to the new TextChatService. You’ll have to use channel:DisplaySystemMessage().

Displaying system messages only works in a local script though (for the speaker).

Does that mean i just need to replace SetCore with DisplaySystemMessage?

Not exactly, take a look at the posts I appended, you have to define RBXSystem channel first, and the passed argument should be written as a string with rich text markup.

1 Like

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