Lua Chat

Hi guys,

I’ve been trying to create a custom chat for my server. I’ve already redone the skin and most of the other essential stuff. For some reason though, when I try to use ‘RunConsoleCommand(“say”, text)’ the chat box doesn’t pick it up and display it. I’ve tried to use GM:OnPlayerChat() and GM:ChatText() to pick up when a user talks but neither of these work. I know the console command is being ran as I’ve debugged that by outputting text to the console. I also know that the chat box does pick up commands from sourcemod. I.E. if I type in ‘/say TextHere’ the chatbox will display [Username]: TextHere. The scripts do not error so I cannot provide any error logs. If anything else is needed, I’d be grateful to give any other files in return for a fix. Thanks.


Also, I believe it is a problem with RunConsoleCommand() as if I use ULX to run a console command off of my player nothing (I.E. My chat message) is shown in the server console nor is an error displayed.

Show the code?

Here’s the code that should be picking up the messages:

function GM:PlayerSay(player, text, team)
if (self.Plugin:Call(“PlayerChatPreCommand”, player, text, team) == false) then
return “”;
if (GM.Command) then
if (GM.Command:ParseSayText(player, text)) then
return “”;
if (self.Plugin:Call(“PlayerChat”, player, text, team) == false) then
return “”
if ( then, text, team);
return “”;

Use [lua] tags on that


Got it working; just needed to re-install the server.