Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I hide messages in my chat gui if they start with a few specific characters?

Hello, I was wondering if anyone could help me learn how I can hide messages in my chat gui if they start with "/e " (including the space after the e). I am using the chat gui script and set up from this tutorial http://wiki.roblox.com/index.php?title=Custom_chat_GUI. All of my code is the same as that code, so I figured it would be less space consuming if I just provided a link.

When hiding a players message that starts with "/e " I would also like to make sure that the message isn't counted into the chat GUI (so the player's name and their text content won't appear nor will there be an empty space, it will simply act as if no message was given.

I would like to note that the message still needs to be accepted because I'm trying to simply block out my admin commands from the chat GUI so people can't see when they're used or what they're used for.

If anyone can help me, it would be greatly appreciated!

1 comment

0

You could use the substring function to check if the first few characters are equal to the command to hide the chat. (msg:sub(1, 3) == '/e ')

1 answer

✓ Accepted answer

Use string.sub(MessageVariable,startposition (usually 1), end position (length of string your checking for)) Eg:

if(string.sub(messagegoeshere,1,2) == "/e") then
...
end

This discussion is preserved as it was. New answers, comments, and votes are closed.