Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

how to filter chat im using commands and i need the chat to filter it?

Asked by 4 years ago
Edited 4 years ago

so i am making commands and i want it if i type / then it wont end up in chat is there any way to do that? so like if i know that it starts with a / how do i disable it from being chatted?

3 answers

Log in to vote
1
Answered by
Erie20 102
4 years ago
Edited 4 years ago

You can start by following this article: https://developer.roblox.com/en-us/articles/Lua-Chat-System

Basically you need to copy all the contents of chat when playtesting the game, stopping the playtest and then pasting the stuff into the empty chat. Then set the scriptable proprrty of chat to true. You can then follow the instructions in the article to create the script you want.

.


local function Run(ChatService) local function createPart(speakerName, message, channelName) if string.sub(message, 1, 5) == "/part" then local newPart = Instance.new("Part") newPart.Parent = game.Workspace return true end return false end ChatService:RegisterProcessCommandsFunction("createPart", createPart) end return Run

as you can see, we create a modulescript, and put it into the chatmodules folder. in the module we have a function called run, and do stuff in the function. we then create a function in the function called create part, which takes in the message, player who chatted it, and the channel or where its been chat. we then get the message and string.sub ("/part",1,5), which checks if the first five characters (1,5) is /part.

If it is, we then create a part, and return true. After that is the end of the function create part.

After declaring the function create part, we have to pass it through the event ChatService:RegisterProcessCommandsFunction.

Hope this helps!

1
is this in a server script? and i dont see where it mutes the player botw_legend 502 — 4y
1
also where do u put it? botw_legend 502 — 4y
1
and how does the function get the speakername,message, and channel name? botw_legend 502 — 4y
1
you put the script into the chatmodules folder. It is a module script. The function gets the speakername, message, and channel name because of the chat function we connected the create part function to. see line 11, ChatService:RegisterProcessCommandsFunction("createPart", createPart) the seond Erie20 102 — 4y
View all comments (5 more)
0
when i paste the chat into the chat and disable LoadDefaltChat non of the chat is there :/ is that normal? botw_legend 502 — 4y
0
so i just made it so load defalt chat is true botw_legend 502 — 4y
0
so it works but in my thing it has an error when i put my code in, it seems that you cant really use remote events in module scripts is there any way around this because what i do with it is i make a system message to all / the person who did the command botw_legend 502 — 4y
1
im not really sure, ive never done chat command filtering before. maybe you could try using bindable events and fire that and have another script listen to the bindable event and then fire the remote event? Erie20 102 — 4y
0
ok thanks ill post a different question about it botw_legend 502 — 4y
Ad
Log in to vote
1
Answered by 4 years ago

U could try making a seperate admin panel, that only takes commands.

0
U wouldnt be able to use the chatted event tho User#34929 0 — 4y
Log in to vote
1
Answered by
nachsor 36
4 years ago

I don't know if this helps but i found someone asking aproximately the same thing on the roblox dev forum. This is the link to it!

https://devforum.roblox.com/t/how-do-i-make-certain-messages-not-show-up-in-chat/104828/6

Hopefully it will help you! :D

Answer this question