If you want to insert chat messages into a table if they begin and end with quotes, do this in a server script inside of ServerScriptService:
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | player.Chatted:Connect( function (message) |
05 | if (#message < 3 ) then return end |
07 | if ((message:sub( 1 , 1 ) = = "\"" ) and (message:sub(#message, #message) = = "\"" )) then |
08 | table.insert(messages, message:sub( 2 , #message - 1 )) |
Now, I wouldn't just throw a bunch of code at you without actually explaining what's being done.
We set up a table that'll hold all of the messages we want, and assign it to a variable called "messages."
Listen for whenever a player joins, and for whenever they chat.
Whenever they chat, make sure the message they're sending is at least 3 characters in length, because there needs to be at least 2 quotes, and a character in between them. If the length of the string is less than 3, exit out of the function.
Otherwise, check to see if the first character in the message is a quote, as well as if the last character in the message is a quote. If it is, then insert the message into the table, excluding the quotes.