Legacy chat system messages wont work

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to create system chat messages inside of the legacy chat.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that my script runs perfectly fine but never does anything.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have rewritten my code three times.

I have also checked out these posts: System Chat Message | Model
Help with message being sent ion chat

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-Server Script- (workspace)

local SystemMessagesEvent = game:GetService("ReplicatedStorage"):WaitForChild("SystemMessages")

warn("server")
game:GetService("Players").PlayerAdded:Connect(function(Plr)
	warn("join")
	SystemMessagesEvent:FireAllClients(Plr.Name.. "Joined HGPDCO!!", Color3.fromRGB(85, 255, 127))
end)

game:GetService("Players").PlayerRemoving:Connect(function(Plr)
	warn("leave")
	SystemMessagesEvent:FireAllClients(Plr.Name.. "Left HGPDCO", Color3.fromRGB(124, 124, 124))
end)

while wait(1) do
	SystemMessagesEvent:FireAllClients("Test", Color3.fromRGB(0, 0, 0))
	warn("sent")
end

-Local Script- (starter gui)

local SystemMessagesEvent = game:GetService("ReplicatedStorage"):WaitForChild("SystemMessages")

warn("local")

SystemMessagesEvent.OnClientEvent:Connect(function(Plr, Message, ColorRgb)
	warn("got")
	
	local Success, Errormsg = pcall(function()
		game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {Text = Message, Color = ColorRgb, Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size24})
	end)

	if Errormsg then
		warn(Errormsg)
	end
end)

I’m not sure why it doesn’t work. Any help is appreciated thanks!

1 Like

I think you messed up when you were writing your Client Connection to your Remote Event, you put the first argument as “Plr” but in the server you defined it as the message. Its important to remember that only when connecting to a remote event on the server the first parameter is set to the player that fired the event.

2 Likes

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