You are not meant to require both the Client and the Server like this.
The proper way to require SocialChat is:
local SocialChat = require(game.ReplicatedStorage.SocialChat);
As for commands, you must use the SocialChat.PlayerChatted method and determine if the player is actually requesting a command etc. Additionally, if you’d like to create a message on the client you must use RemoteEvents to accomplish this due to the fact that the :CreateChatMessage method can only be called by a client/LocalScript. Hope this helps!
This chatting system is really exciting, I love how you can type in custom emojis, to enhance peoples engagement between servers, custom tags and custom emojis are a great addition to a custom chat starting out unique, can’t wait for more updates from you guys!
The server/client module automatically gets fetched by the initializer module. (which should be the main module in ReplicatedStorage)
The type of module you recieve depends on your scripting environment ^^ (eg. ServerScripts get the Server module while LocalScripts get the Client module)
Oh yea, and also, :CreateChatMessage() doesnt really work as it seems.
It does register the command, but it doesnt create the chat message, but instead it gives me this: 12:57:01.548 ServerScriptService.Commands:5: attempt to index nil with 'CreateChatMessage' - Server - Commands:5
This is the code I am using to pull this off:
local SocialChat = require(game.ReplicatedStorage.SocialChat)
SocialChat.PlayerChatted:Connect(function(playerWhoChatted, messageSent)
if messageSent == "/ping" then
SocialChat.ChatService:CreateChatMessage(
"TIP", -- this parameter can be set to "nil" if you dont want a speaker tag in your message
"Pong!",
{
["MessageColor"] = Color3.fromRGB(155, 65, 65),
["SpeakerColor"] = Color3.fromRGB(255, 80, 80)
}
);
end
end)
It’s the SocialChat Service itself. No changes whatsoever made to it. (I should also probaly mention that it is from your uncopylocked Social Chat testing place)
Btw, I have a suggestion on how to improve the chat.
Make support for gradient texts. I tried to do it myself, but since the chat sentence consists of separate text labels, the gradient is superimposed on each letter, so official gradient support would be good
I joined the game on my phone and the text box did this
I have no idea how this happened. All i did was join and start typing and it did this. My assumption is that stuff isnt scaling properly (but dont take my word for granted, i dont know much about GUIs).
It doesn’t cause anything to break, but its just infuriating.