ChatMakeSystemMessage not firing

hey there, Im working on a discord bot that allows members within a specific server to chat with people in game. I have the backend for the discord bot working 100% so Im not going to provide that code. I have tested it and it is definitely not the error. The issue Im having is that ChatMakeSystemMessage is literally not working at all. here is my server code:

connection:on("message", function(args)
	args = game:GetService("HttpService"):JSONDecode(args)
	
	local msg = ""
	
	for i, v in ipairs(args) do
		print(msg)
		msg = msg..v.." "
	end
	msg = msg:gsub(".?$","")
	
	print("message:", msg)
	game.ReplicatedStorage.Connection:FireAllClients(msg)
end)

know that there is 0 problem here. I have debugged this pretty heavily using print statements and this works 100% as intended.

client script:

game.ReplicatedStorage.Connection.OnClientEvent:Connect(function(msg)
	print("message (client):", msg)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = msg,
		Color = Color3.fromRGB(0, 197, 197),
		TextSize = 30
	})
	script.Parent.Parent.PlayerGui.ScreenGui.TextLabel.Text = msg
end)

the odd thing here is that the line that changes the GUI works 100%. I added it as a test to see if the issue is ChatMakeSystemMessage or something else, and oddly it seems to be ChatMakeSystemMessage.

there are 0 errors within output, and it seems to be correct syntax. Im super confused as to why ChatMakeSystemMessage would behave like this, I would love for anyone to help me.

(don’t mind the fact that I currently have 0 filtering in place, it will be added as soon as this is figured out.)

edit: I forgot to include the fact that the code

game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = msg,
	Color = Color3.fromRGB(0, 197, 197),
	TextSize = 30
})

has been stolen directly from another one of my games and works fine within that game.

What does this print?

msg prints whatever is sent over from discord. If someone in discord types “hello everyone” msg prints out “hello everyone”.

Are you sure that msg is a string?
print(type(msg)) if isn’t then just use tostring(msg)

just confirmed msg is a string, also I tried ChatMakeSystemMessage with something I knew was a string (“test value”) and that did nothing also.

Have you tried setting up its font?

tried copying code from an alvinblox tutorial that included font, this didnt work either for some reason which is odd because alvinblox proved it worked within the vid

are you using textchatservice or legacychatservice in your game’s textchatservice object?

textchatservice. Should I be using legacy?

try it i guess, my server side chat messages stopped working when i switched to textchatservice.

legacy fixed it! Annoying that I cant use Text, I prefer it.

1 Like

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