Roblox is a social platform designed to bring users together in experience around around the world. Many developers create unique assets within these experiences to enhance social aspects of their games. However, not everyone knows how to make unique eye-appealing visuals that encompass these aspects.
SocialChat aims to assess these issues by providing developers with complete control over their games regardless of their skill-levels! Below are a few notable features…
Support for Custom Emojis
*Only accessable with the Emojipedia extension
Gradient Effects
An expansively configurable Bubble-Chat system
Chat Highlights for readability
A Control Panel for an optimal user-experience
…and much more to come soon!
You can grab the latest version or check out the system for yourself in game!
đź“ś Documentation đź“ś
An official website will be created soon, but for now here’s how you can maximize your usage with SocialChat’s extensive API!
Initially, you must retreive the SocialChat module in your desired script by using the following code:
local SocialChat = require(game.ReplicatedStorage:WaitForChild("SocialChat"));
Additionally, any references to the keyword "this"
are strictly refering to Object-Oriented References.
đź–Ą Server API
Please note that SocialChat API methods come from the components, NOT from the module itself.
If you would like to use any of these api’s, please reference the Src
framework as follows:
local API_TO_GET = SocialChat.Src.API_TO_GET
--- Ex:
local Channels = SocialChat.Src.Channels
Channels:ThisMethod() -- runs ":ThisMethod()"
đź“® Channels
.new( Name : string ) : Channel < table >
→ Creates a new Channel that can be used to replicate messages to clients.
:Get( ChannelName : string ) : Channel? < table>
→ If the queried channel exists, this method will return it.
:Message( Speaker : Speaker < table >, Message : string, Recipient : Player | Channel )
→ Replicates the provided message IF the speaker and recipient exists. Please note that messages must not be over 200 utf8 characters, otherwise the API method will fail.
:AddValidator( Validator : Function )
→ Adds a “gateway” validator that should return true/false/nil for any passed message values. This is useful for hiding admin command messages. Returning true
with your Validator function will prevent the specified message from being sent.
Channel:Subscribe( Player : Player )
→ When creating new channels with the ChannelAPI.new()
method, you must subscribe the desired players to the new channel, otherwise messages sent to this channel will not register for players who are not currently subscribed to it.
Channel:Unsubscribe( Player : Player )
→ Unsubscribes the requested player from this channel. This will delete all rendered instances on the player’s end and will prevent the player from receiving new messages from this channel.
Channel:Remove()
→ Destroy’s this channel instance. All players that are subscribed to this channel will be unsubscribed automatically.
.OnMessageSent:Connect(function( Speaker : Speaker, Message : string, Recipient : Player | Channel ))
→ An event that fires whenever a new message is sent to any channel. This universal event will collect all messages, however, please note that messages received from this event are not filtered. This is solely for API usage.
đź’¬ BubbleChat
:Chat( Speaker : Speaker, Message : string )
→ Replicates the provided message using the Speaker provided. This will not create a message in the Channel frame for clients, but it will display a visible chat bubble over the specified speaker’s Author variable.
🎞 DataService
SocialChat’s DataService is fairly gimmiky and I understand it may be confusing to interpret, but the reason for it’s structuring is solely to prevent exploiters from creating infinite data on your DataStores.
To start, each DataStore structure in a player’s data must be structured in the following way for each value.
{
["Default"] = any, -- The default value for this entry. Any new values must be the same TYPE as the default value to be set successfully
["Value"] = any?, -- This is the user's data value. DataStore's will save this and use this over the "Default" data value (opt. & can be nil initially)
};
To SET new data from the client to the server, you must use the EventDataEntry RemoteEvent and provide a Path and a Value parameter.
Example:
game.ReplicatedStorage.SocialChatEvents.DataService.EventDataEntry:FireServer("Entry-1/Entry-2/Entry-3", true); -- Sets the value of "Entry-3" to "true"
How do paths work?
Similarly to standard file referencing, you must reference the exact location of your data entry to set and change data.
For example, if we were to change a value in a table which can be referenced in a script as PlayerData.Settings.MaxFontSize
, we would want to reference that entry by using the path:
local EntryPath = "PlayerData/Settings/MaxFontSize"
đź“Ł Speakers
Speakers allow SocialChat to easily reference Metadata assigned to Agent instances. An Agent is an instance that has been assigned with a certain set of metadata.
.new( Agent : BasePart | Player | string, TagData : table ) : Speaker < table >
→ Creates and returns a new Speaker using the specified speaker values
:Get( Agent : BasePart | Player | string ) : Speaker? < table >
→ Returns the requested speaker IF they exist. Otherwise, returns nil.
.OnSpeakerAdded:Connect(function( SpeakerAdded : Speaker ))
→ An event that fires whenever a new speaker is registered
How does TagData look?
The “TagData” parameter for Speaker.new() is a table of data that can be used to change the appearance of the speaker’s chat instances. This can change the speakers, Bubble Chat apperance, Chat Frame rendering appearance, and more!
For reference, each TagData table must follow the following structure, otherwise an error will be thrown.
Structure Reference:
{
Color = Color3.fromRGB(...), -- opt.
Name = "YOUR_NAME_HERE", -- opt.
Font = Enum.Font
}
General Reference:
{
["Classic"] = { -- ChatFrame metadata
["Tag"] = {...structure}, -- The user's 'tag' metadata in the ChatFrame
["Content"] = {...structure}, -- The user's 'message' metadata in the ChatFrame
["Username"] = {...structure} -- The user's 'username' metadata in the ChatFrame
},
["Bubble"] = { -- BubbleChat metadata
["BubbleTransparency"] = 0, -- The bubble's background transparency
["BubbleColor"] = Color3.fromRGB(...), -- The bubble's background color
["TextColor"] = Color3.fromRGB(...), -- The bubble's text color
["Font"] = Enum.Font..., -- The bubble's Text-Font
}
};
đź’» Client API
Please note that SocialChat API methods come from the components, NOT from the module itself.
If you would like to use any of these api’s, please reference the Src
framework as follows:
local API_TO_GET = SocialChat.Src.API_TO_GET
--- Ex:
local Channels = SocialChat.Src.Channels
Channels:ThisMethod() -- runs ":ThisMethod()"
All ClientAPI methods are specifically related to the client that uses these methods. For a better understanding, please reference the Server-Client Model.
đź’¬ BubbleChat
:GetControllers() : table
→ Returns a list of all registered BubbleChat controllers on this client.
.new( Agent : BasePart | Player | string, Metadata : table? )
→ Registers a new BubbleChatController using the provided Agent
and Metadata
parameters.
BubbleController:Chat( Message : string ) : BubbleCollection < table >
→ Renders a new Bubble-Message for this controller using the provided Message
string.
BubbleController:Destroy()
→ Destroys this BubbleController
BubbleController.Thinking : boolean
→ A changable variable that strictly accepts boolean
values. If true, a thinking bubble will display above the registered Agent’s Instance. (and vise-versa)
BubbleController.Enabled : boolean
→ A changable variable that determines if the BubbleController is currently enabled visibly. This will not prevent the BubbleController from enabling itself again after being used. To do this, you must set the BubbleChatSettings.IsBubbleChatEnabled value to false
.
đź“® Channels
:Create( Name : string, Members : table?, ChatHistory : table?, IsPrivate : boolean? ) : Channel
→ This method will register a new channel for our client. If more than 1 channel is currently rendered, this will enable the Channel Navigator menu and will automatically create a NavButton for the specified channel.
:Get( Query : string ) : Channel?
→ Returns the specified channel if found. Otherwise returns nil.
:GetFocus() : Channel
→ Returns the client’s currently focused channel
:SendMessage( Text : string, Receiver : ( Player | Channel )? )
→ Sends a message to the server to the client’s currently focused channel OR a specified receiver (if any)
.Registry : table
→ A table that references all currently registered Channels
.OnMessaged:Connect(function( Message : string, Metadata : table, Channel : Channel, IsPrivateMessage : boolean? )
→ An RBXScriptSignal that fires whenever a new chat message is rendered on the client.
:CreateSystemMessage( Message : string, Metadata : table?, Channel : Channel? )
→ Creates a system message without the usage of a Speaker object in the chat frame. This message will send to the client’s currently focused channel unless a Channel
parameter is passed. Furthermore, this system message will ONLY render in the client’s chatframe. Other clients will not see this message.
Channel:Focus()
→ Forces the client’s ChatFrame to focus on this channel
Channel:Message( Message : string, Metadata : table?, IsPrivateMessage : boolean? ) : RenderedContent < table >
→ Renders a message to this channel based on the provided parameters. Please note that this API call was designed for servers, but you may also use it over :CreateSystemMessage
if preferred.
Channel:Destroy()
→ Destroys this channel and removes all of it’s rendered contents.
🎨 ChatUIManager
:SetEnabled( State : boolean, NoTween : boolean? )
→ Sets the visiblity of the ChatFrame UI. This will not fully-disable the chat
:IsEnabled() : boolean?
→ Returns a boolean that states if the chat is currently enabled
:SetMode(IsFrameHidden : boolean)
→ Similar to having a TextBox only mode, this method will set the chat’s ChatFrame state to the provided IsFrameHidden value.
:Interact()
→ Pings the client with a spoofed interaction call. This prevents the chat frame from fading away.
đź“Ą InputBox
:Set( Content : string, CaptureClientFocus : boolean? )
→ Sets the text within the Chat frame’s InputBox to the specified content string. This should always be used when programmatically changing the InputBox’s text.
:Submit()
→ Submits the current text within the InputBox to the server for replication.
Alternatively, if you’d like to edit the source code itself, you can get it for yourself by running the following command in Roblox Studio’s command bar!
loadstring(game:GetService("HttpService"):GetAsync("https://pastebin.com/raw/ddVNfyrZ"))();
🎆 Developer Notes 🎆
With SocialChat’s new branding, I would like to further state that this resource has taken an infathomable amount of time on my behalf – 6 Months for v2 specifically – because I wanted to polish the system as much as possible. With the bugs and issues that arised from Social Chat v1, I was simply unhappy with how poorly executed my vision was. Hence, why I created v2.
Please consider donating via the Control Panel in game as this resource has costed me tons to publish for free. I do not expect income from this project, but it will be difficult to fund future resources without some help.
If you have questions and/or feature suggestions, feel free to post them here or create a ticket in our community server!
Happy developing!
- Cosmental
✨ Credits ✨
Make sure to thank these individuals for making SocialChat possible!
- @Captide for creating the SocialChat brand
- nooneisback for their SpriteClip module
- ForeverHD and the Nanoblox Team for their contributions in TopbarPlus
- fivefactor for their UI-Plugin Interface Tools
🎫 Poll 🎫
(for research purposes!)- Yes
- No
0 voters
- Yes
- No
0 voters
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
0 voters