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.