Answered by
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.
.
01 | local function Run(ChatService) |
02 | local function createPart(speakerName, message, channelName) |
03 | if string.sub(message, 1 , 5 ) = = "/part" then |
04 | local newPart = Instance.new( "Part" ) |
05 | newPart.Parent = game.Workspace |
11 | ChatService:RegisterProcessCommandsFunction( "createPart" , createPart) |
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!