Getting error loading chat modules

Okay, so I got a chat module in my game that is formatted like this:

However I get constant errors loading the “ChatMain” module in the ChatScript, and the “ChatSettings” module in the Proximity script. Here is evidence that they are in the correct locations:

Here is the error I get loading the modules in the developer log

Error comes from ChatScript line 15

Unsure why this error occurs and why it fails to load the chat modules but it breaks my game, and players who first join the game can use the chat. However if they were to rejoin the server the chat breaks and overlaps itself like so:

This is how the chat is SUPPOSED to look:

Any help on getting this game breaking bug fixed? Since my game relies entirely on communication and interaction between players, this is a big obstacle for me and after days of trying fixes I decided to come to the dev forums. Anyone please help

Ooooh I’m working on the exact same thing, exact same rp-style chat (based off GMod HL2RP), I had a similiar issue where the chat would attempt to convert a regular message to an OOC message (through a MessageCreatorModule script as well) and it errored when it received improper input such as a blank message, this in return broke all the other running modules and players who would join would as well get a broken chatbox and would be unable to speak, fixed this by sanitizing what was being processed and extensive print testing, that’s all.

Oooooh snap I love hl2 and Gmod, send me the link to it in DM’s. But in terms of this post all of the things work, shout, ooc, 911 calls, /me, whisper, police radio, proximity etc. Its just that the module fails to load for some strange reason and because of that it breaks all of my other scripts

It’s not ChatScript that’s experiencing an error, that code works perfectly fine. The original chat script works by requiring ChatMain directly as well (you do not need a while loop for this). The error is being thrown because a ModuleScript is experiencing an error, therefore the require fails.

I think you’re going to want to address that second error first before revisiting the error with ChatScript. It seems that the OCommandMessage module is experiencing an error which is in turn affecting any scripts requiring it to function. It should be the first error printed though, strangely.

Are you able to share the code you are currently using for OCreatorMessage or if not the whole module, some snippets around the line of error (43)? I remember dealing with a Lua Chat System error before where the whole system broke due to error in a MessageCreatorModule.