Plr.Chatted is confusing

Hello, I am currently trying to make a chat module however I noticed that players in my game are not able to use my chat commands. My chat module is also public so it has to be connected to the plr.Chatted function.

I have seen a lot of custom guis that have done this and I was wondering how to connect my gui to the plr.chatted event so when someone sends a message through my custom chat it also runs the plr.chatted event.

example:
image

This is a tutorial article that I found in the Roblox Developer Devforum, In the post, will show you step by step on how to make a chat custom command. It is very useful!!

Article: How To: Make Chat Commands

1 Like

Make sure you read the content of my post and post again

By any chance, what do you mean by how to connect your GUI to the plr.Chatted event?

Try this:

3 Likes

You’re better off just utilizing the new TextChatService for the best results. I use it for my own chat system and it’s amazing. TextChatService | Roblox Creator Documentation

by the way how do I connect my chat to the chat button and remove any other custom gui that may exist (since its public it can be run in other games and I want it to automatically remove all other chat systems)

There’s no foolproof way of doing that. The game owner should be in charge making sure there’s an adequate chat system.

1 Like

whats a non foolproof method? maybe I check the size of the gui and the position

hey I have been looking at SendAsync cause it looks like the thing I need in order to make chat commands work with my thing.

here is the documentation:


however i cant figure out how to send a message

You can create a Remote Event that your module fires. Any other scripts can attach to this event to receive when your custom module gets a chat message.

dude this a public module not just my chat system. I cant trust other devs to make code specifically for my chat system

Well, the only other option is to have bubble chat enabled. And have your chat module work off of the .Chatted event through the Roblox bubble chat.

Hello I have a remote event that fires to a script which fires to all clients so everyone sees the bubble chat:

	local ChatService = game:GetService("Chat")
	
	local MEssageman = game.Players:FindFirstChild(them.Name).Character
	
	ChatService:Chat(MEssageman, msg, Enum.ChatColor.White)

I also have this local script to detect for chat messages

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		warn("SUCCESS")
	end)
end)

It does NOT fire the chatted event

Hi, bit confused what you are trying to convey? Neither the quote, your message, or your code are referencing the same thing.

I’m more responding to your original question in the first post. If you’re making a custom chat module you will need to make you own event connections by using RemoteEvents or BindableEvents to create a custom event for when messages are created through your chat module.

Hello I don’t believe you understand my message. I understand it can be confusing for certain people. When I show my code, I do not include everything. This is because I don’t feel like creating a script for you and my code is way too big to send. In the first message, it represents the code I put inside of my onremotevent. I dont feel like it matters whether I show you all my code since it works but it does not fire the .chatted event

Your custom chat module will never be able to fire the .Chatted event. Have other scripts listen for the RemoteEvent’s signal that your chat module is sending the data over.

plr.Chatted is an event that is part of Roblox’s chat module so you can not use it unless you modified Roblox’s chat module, which is less user friendly than just making a custom event.

I do not care about roblox’s chat module.

is an extreme lie and thats just because you dont know. There are hundreds of chat modules that fire the .chatted event. I do not care about robloxs chat module I just want to fire the chatted event

the Player.Chatted signal can’t be fired from a custom script, your best bet is customizing the built-in chat ui

don’t believe me? try calling game:GetService(“Players”):Chat(“test”) from the client, you’ll see
Players:Chat is a function that fires the signal, but it is restricted

Could you please show me such modules. Since I would be very interested in learning how developers have been able to tap into Roblox’s existing event signals.