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?
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.