So I see that some games that send 'fake' text to the chat, while still using roblox's chat gui, not a custom chat gui. 'fake' because it isn't a player saying it, it's the game saying it. Like this: https://gyazo.com/51c478f43e58a1ea842dd4db38967bf0 How do I do that?...
Note: This feature will only work in a LocalScript (or a ModuleScript running on the client)
Note: EVERYBODY will see this message.
What you're talking about is making a chat message via the core gui's.
As it says in the Wiki, "SetCore" , you need to do the following.
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ --Getting "StarterGui" and calling the function Text = "Welcome to my game!"; -- Required. Has to be a string! Basically what the chat says 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) If you require a full set http://snipplr.com/view/40782/color-to-rgb-value-table-in-lua/ Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18 })
For example;
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ --Getting "StarterGui" and calling the function Text = "Your data has been saved"; Color = Color3.new(0/255, 128/255, 0/255); Font = Enum.Font.SourceSans; FontSize = Enum.FontSize.Size24; })
This would print out like; As you said, https://gyazo.com/51c478f43e58a1ea842dd4db38967bf0
Currently, SetCore has the following options,
PointsNotificationsActive: boolean: whether or not a notification should be shown when a player gains or loses playerpoints
BadgesNotificationsActive: boolean: whether or not a notification should be shown when a player earns a badge
ChatWindowSize: UDim2: Sets the size of the chat window. Note: This size does not include the chat bar.
ChatWindowPosition: UDim2: Sets the position of the chat window.
ChatBarDisabled: boolean: If set to true, the chatbar will be hidden, effectively muting the player.
ChatMakeSystemMessage: table: Allows you to add messages to the chat (like the help message when you join a game)
SendNotification: table: Makes a notification pop up
I hope I helped!
You can use SetCore
SetCore( string CoreName, var Parameters ) -> void
You want to use ChatMakeSystemMessage as the CoreName
. The valid parameters for ChatMakeSystemMessage are poorly documented, but the example should provide what you need.
Example:
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 })