Basically, when I type anything prefixed by / or ! I don’t want it to show up in chat.
I’m aware that you can set the individual command to be hidden in the ULX files, but when you have a lot of commands that’s a ton of work.
I’d rather everything which starts with a / or a ! is completely blocked from the chat.
Not trying to ask anyone to code for me, I know it might sound like that. Could just use a few tips on how I can achieve this. Thanks.
Solution by MPan1:
hook.Add( "PlayerSay", "DontShowStuff", function( ply, text, team ) local firstchar = string.sub( text, 1, 1 ) -- this gets the first character of the text typed, e.g. ! if ( firstchar == "!" ) or ( firstchar == '/' ) then -- if the first character is ! or / then return '' -- this makes the text not get printed in the chat end end )
Add to lua/autorun/server