Put it in a LocalScript, running on the client, use RemoteEvents if necessary, e.g.
2 | game.Workspace:WaitForChild( "MakeAChat" ).OnClientEvent:Connect( function (msg) |
3 | game:GetService( "StarterGui" ):SetCore( "ChatMakeSystemMessage" , { |
4 | Text = "[SERVER]: " .. msg; |
5 | Color = Color 3. new( 0 , 1 , 0 ); |
6 | Font = Enum.Font.SourceSans; |
7 | FontSize = Enum.FontSize.Size 24 ; |
2 | local remote = Instance.new( "RemoteEvent" ) |
3 | remote.Parent = workspace |
4 | remote.Name = "MakeAChat" |
5 | game.Players.PlayerAdded:Connect( function (plr) |
6 | remote:FireClient(plr, "Why, hello there!" ) |
7 | remote:FireAllClients(plr .. " has joined the game!" ) |
The upside to this, is you can send a message to only one client at a time, or to everyone by using FireAllClients()
Reference