Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to have a script say something inside chat?

I'm wondering how to make a script say something in chat. Simply what function lets you do this? I know print() types to the console, but what would say something in player chat?

1 comment

0

If this isn't clear, then let me set an example. In most GMod or Minecraft servers, when a player joins, it will post a comment in chat saying "(name) has joined the server."

1 answer

✓ Accepted answer

Yes, you can have the script say something in chat using ChatMakeSystemMessage. Example straight from the wiki:

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
	Text = "Welcome to my game!"; -- Required. Has to be a string!
	Color = Color3.new(0,1,1); -- Cyan is (0,255/255,255/255) -- Optional defaults to white: Color3.new(255/255, 255/255, 243/255)
	Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold
	FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18
})

This would have to be in a local script. I just performed some tests on it, as well, and you CAN make multiple messages, triggered by what you choose:

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
	Text = "Testing this out!";
	Color = Color3.new(0,1,1);
	Font = Enum.Font.SourceSans;
	FontSize = Enum.FontSize.Size24; 
})


wait(10)


game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
	Text = "Let's see if I can do it twice!";
	Color = Color3.new(0,1,1); 
	Font = Enum.Font.SourceSans;
	FontSize = Enum.FontSize.Size24;
})

This script produced this result. Here's a link to the wiki, as well.

This discussion is preserved as it was. New answers, comments, and votes are closed.