I've put the script in a local script since StarterGui:SetCore must be called from a local script and I've also put it in the StarterGui but it still doesn't work. I know the MakeChat function works, but when I add the function that connects it to a player joining it stops and doesn't print the text in chat.
function MakeChat(Msg,Color)
Color=Color or Color3.new(0,1,0)
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
Text = Msg;
Color = Color;
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
})
end
function onPlayerEntered(nP)
MakeChat("[SERVER]: Welcome, "..nP.Name.."!", Color3.new(12,130,22));
end
game.Players.PlayerAdded:connect(onPlayerEntered)
Any clue on how to fix?

2 comments
have you tried using a variable for the msg or simple test text? Could be the way its formatted. Is it giving an error?
no error, nothing in output or anything