Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

SetCore:ChatMakeSystemMessage not working inside of RemoteEvent.OnClientEvent. How do I fix this?

Asked by
FHGDev 25
4 years ago

Today I was making a custom command on Kohl's Admin to make a system message in the chat with given text. I setup the code in the custom commands module, then I setup the RemoteEvent needed to carry out this action. I put this code in a LocalScript in StarterPlayerScripts. The weird thing is, the print function works, but the SetCore doesn't. This has been happening to me for a while now, and it's getting kind of annoying.

Anyways, here's the code:

local msm = game.ReplicatedStorage.MakeSystemMessage

msm.OnClientEvent:Connect(function(player,message)
    print("Event fired!") -- this fires

        game.StarterGui:SetCore("ChatMakeSystemMessage", { -- this doesn't
            Text = "[SYSTEM]",player.Name..":",message;
            Font = Enum.Font.ArialBold;
            Color = Color3.fromRGB(255,0,0)
        })
end)
0
and yes, I made sure to run FireAllClients on the server FHGDev 25 — 4y
0
What makes you think it only breaks when it's in OnClientEvent? hiimgoodpack 2009 — 4y
0
@RHG solved it for me on Code's discord. Thanks anyway. It turned out that the function wasn't liking the commas FHGDev 25 — 4y

Answer this question