You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to create system chat messages inside of the legacy chat. -
What is the issue? Include screenshots / videos if possible!
The issue is that my script runs perfectly fine but never does anything. -
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!