Chat Commands Module

raBBish made a chat command module and it works. But if you just type in the character prefix and no command or arguments, it errors with this:

Hook ‘ChatCommand.ParseChat’ Failed: [gamemodes\gamemode_test\gamemode\chatcommand.lua:25] attempt to index local ‘command’ (a nil value)
There’s his thread.

When this error happens, the entire thing breaks. Which is bad, seeing how it’s very easy to do.

I didn’t know if I should post the problem here, or in the original thread. It seemed old, so I didn’t know if I should bump it or not.
I like to think of myself as a decent coder, but I haven’t been able to fix it. I don’t mess with modules, even though it’s still lua. Just the code in it makes my head go all [img_thumb] [/img_thumb]

Try replacing the chatcommand.lua with this:

I can’t try it myself, don’t have GMod installed. If it works, I’ll update the old download.