How would I run a string of code in the game if a user chats exactly this,
/m Server Hello!
This is a rough example.
Example
When a player says this \m Server Hello!
It would run this code
workspace.Chat:FireServer("PushChat","[Server]","Hello!")
That code would add a new line to the chat(I already know how to do this) and it would say this in the chat.
Notice how in that chat line it has 3 specific objects
/m -- Runs the Command
Server --The ChatType
Hello! --The Message
Those would correspond to this.
workspace.Chat:FireServer("PushChat","[ChatType]","Message")

17 comments
Wait, that was just an example. I want to force a chat Gui to say this [Server]: Shedletsky has joined the server! I was using that as an example. I want to understand how to define more than one item in a chat line and assign it.
Ok i'll write more on it and how to assign it.
When a player says this \m Server Hello! It would run this code workspace.Chat:FireServer("PushChat","[Server]","Hello!") That code would add a new line to the chat(I already know how to do this) and it would say this in the chat. [Server]: Hello!
Oh, that was a bit unclear i'm also writing while doing this.
I have a custom chat by the way.
I edited my question.
Edited my answer also.
Is that what you wanted?
Alright, well that would work but not the way I want it to, What if they change the message? How would I make these two variables manipulable? 'ChatType', 'Message'
ChatType would be "Server" and Message would be "Hello!"
Do you want it to say something else too? Or not because it only work if they chat it exactly.
You know in admin command scripts how they can say different things in a command? (something to do with string.sub(1,4) or something..) Like they can do "ChangeStats Intel 500" They can change Intel and 500 to whatever they want to..
Updated tell me if it works?
Would server be able to be manipulated too?
I think so.
Yeah it does.
Thanks for the help! :)