Custom chat module in the works

I am currently working on a custom chat module. It’s gonna have custom commands, and a whole lot of other things.

Current commands I have in mind:
/chatcolor
/chatnamecolor
/charactername
/chatname
/globalname

Explanation:
/chatcolor changes your chat color
/chatnamecolor changes your name color in the chat, for example:
“[Player]: sampleText”
it would change the color of Player
/charactername changes the name of your character, puts a name above your character
/chatname changes your name in the chat
/globalname changes your name in the chat and above your character.

How they would be used:
/chatcolor blue
/chatnamecolor red
/charactername noob
/chatname guest
/globalname bacon

Current script:

local function Run(ChatService)
	local Channel = ChatService:AddChannel("Main Chat")
	local Util = require(script.Parent:WaitForChild("Util"))
	Channel.AutoJoin = true
	Channel.WelcomeMessage = "Welcome to "..game.Name.."! For custom chat commands, type /chatCommands"
	
	local function onSpeakerJoined(speakerName)
		Channel:SendSystemMessage(speakerName.." has joined the game.")
	end
	
	local function onSpeakerLeave(speakerName)
		Channel:SendSystemMessage(speakerName.." has left the game.")
	end
	
	local function chatColor(speakerName, message, channelName)
		if string.sub(message, 1, 14) == "/chatcolor red" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(255, 0, 0))
			return true
		elseif string.sub(message, 1, 15) == "/chatcolor blue" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(0, 0, 255))
			return true
		elseif string.sub(message, 1, 16) == "/chatcolor white" or string.sub(message, 1, 17) == 
"/chatcolor normal" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 255))
			return true
		elseif string.sub(message, 1, 17) == "/chatcolor yellow" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
			return true
		elseif string.sub(message, 1, 16) == "/chatcolor green" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(0, 255, 0))
			return true
		elseif string.sub(message, 1, 17) == "/chatcolor purple" then
			speakerName:SetExtraData("ChatColor",Color3.fromRGB(61, 21, 133))
			return true
		end
		return false
	end
	
	ChatService:RegisterProcessCommandsFunction("chatColor", chatColor)
	game.Players.PlayerAdded:Connect(onSpeakerJoined)
	game.Players.PlayerRemoving:Connect(onSpeakerLeave)
end

return Run

Reply with more commands or if I could change the format of a few commands or the script.

Edit: I’ve made a typing notice and a custom chat bubble. Here are both of those things:
robloxapp-20201011-1338007.wmv (3.5 MB)

4 Likes

That’s great! I would love to use something like this. I do have a question though. Would there be ways to enable/disable user permissions to use certain commands?

What do you mean? If you are talking about admin commands, then I can create the normal one then copy and paste it and create a admin commands version.

I mean like, take for instance /globalname. If a game developer didn’t want that in their game, could they disable the command for the players? Or if the game developer only wanted people with a game pass to be able to change their chat color?

/globalname only names you. It names your character and chat name

Yes, I know that, but could it possibly be disabled if the game developer didn’t want it?

I could try to make that. I need to think something up so that will work

I was just wondering, don’t feel pressured to do it :slight_smile:

No, it’s fine. That is a good addition.

Cool I am excited when it comes out!