For example I am editing the current Roblox chat system visually to better fit my game, my game is a roleplay game which allows those to create their own characters. Now how would I get the name of the character to appear in the chat instead of the name of the player.
So instead of the chat saying
marcus760: Yo wassup?
it should say
General Robloxia: Yo wassup?
Is there any way I can hijack the current chat system and replace the string value to substitute the username behind the colon?
The name format is done in MessageCreatorModules. You can fork this section of the Lua Chat System, remove the pieces you do not use and change them accordingly.
There is a name format constant in the DefaultMessageCreator which contains this string: “[%s]”. Changing the name thus involves modifying this string to wherever you keep your name string.
Be cautious when changing names with the Lua Chat System though. It can be possible for users to set their roleplay names to that of real users, thus impersonation. Sending bad messages on behalf of another user can result in severe punishment. You should always leave the player’s real name visible somewhere. This is commonly why name systems for the chat have a format like “RP Name (Username)”.
I’ve got a custom name selection system in place to avoid impersonation. Players can only select from a group of preset names, sort of like code names or nicknames. I’ll give this a try and let you know how it goes. Thank you.