Chat command enhancer
Key RequiredUniversal

Chat command enhancer

Universal ScriptJoyful_PizzaPartylJoyful_PizzaPartyl 412 views 130 executesUpdated Jan 26, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•177 lines (4063 chars)
--[[
Roblox Chat Command Enhancer (LocalScript)
Adds extra chat commands & text modifiers

Commands:
!chat reverse <text>
!chat corrupted <text>
!chat mimic <player>
!chat mimic stop

Text modifiers:
#smile  -> 😃
#sad    -> 😔
/n      -> newline

Other:
>console <message>   -> prints to console
$execute <lua>       -> executes Lua code (local)

NOTE:
- LocalScript only affects YOUR client.
- Uses TextChatService (new chat). Falls back if needed.
- $execute is powerful. Use only for testing.
]]--

local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local LocalPlayer = Players.LocalPlayer

local mimicTarget = nil
local isMimicking = false

-- =========================
-- Utility functions
-- =========================
local function reverseString(str)
	return str:reverse()
end

local function corruptString(str)
	local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-="
	local result = {}
	for i = 1, #str do
		local ch = str:sub(i, i)
		if math.random() < 0.35 then
			table.insert(result, chars:sub(math.random(1, #chars), math.random(1, #chars)))
		else
			table.insert(result, ch)
		end
	end
	return table.concat(result)
end

local function applyTextModifiers(text)
	text = text:gsub("#smile", "😃")
	text = text:gsub("#sad", "😔")
	text = text:gsub("/n", "\n")
	return text
end

local function sendMessage(text)
	if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
		TextChatService.TextChannels.RBXGeneral:SendAsync(text)
	else
		game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(text, "All")
	end
end

-- =========================
-- Command handler
-- =========================
local function handleCommand(message)
	-- !chat reverse
	local rev = message:match("^!chat%s+reverse%s+(.+)")
	if rev then
		sendMessage(reverseString(rev))
		return true
	end

	-- !chat corrupted
	local cor = message:match("^!chat%s+corrupted%s+(.+)")
	if cor then
		sendMessage(corruptString(cor))
		return true
	end

	-- !chat mimic stop
	if message == "!chat mimic stop" then
		isMimicking = false
		mimicTarget = nil
		warn("Mimic stopped")
		return true
	end

	-- !chat mimic <player>
	local targetName = message:match("^!chat%s+mimic%s+(%w+)")
	if targetName then
		for _, plr in ipairs(Players:GetPlayers()) do
			if plr.Name:lower():sub(1, #targetName) == targetName:lower() then
				mimicTarget = plr
				isMimicking = true
				warn("Now mimicking:", plr.Name)
				return true
			end
		end
	end

	-- >console
	local con = message:match("^>console%s+(.+)")
	if con then
		print("[Console Message]", con)
		return true
	end

	-- $execute
	local exec = message:match("^%$execute%s+(.+)")
	if exec then
		local f, err = loadstring(exec)
		if f then
			f()
		else
			warn("Execute error:", err)
		end
		return true
	end

	return false
end

-- =========================
-- Mimic listener
-- =========================
local function setupMimic(plr)
	if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
		plr.Chatted:Connect(function(msg)
			if isMimicking and plr == mimicTarget then
				sendMessage(msg)
			end
		end)
	end
end

for _, p in ipairs(Players:GetPlayers()) do
	setupMimic(p)
end
Players.PlayerAdded:Connect(setupMimic)

-- =========================
-- Main chat hook
-- =========================
if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
	TextChatService.OnIncomingMessage = function(message)
		if message.TextSource and message.TextSource.UserId == LocalPlayer.UserId then
			local text = message.Text

			-- modifiers
			text = applyTextModifiers(text)

			-- commands
			if handleCommand(text) then
				return TextChatService:CreateTextMessage("", message.TextSource)
			end

			return TextChatService:CreateTextMessage(text, message.TextSource)
		end

		return message
	end
else
	LocalPlayer.Chatted:Connect(function(msg)
		local modified = applyTextModifiers(msg)
		if handleCommand(modified) then
			return
		end
		sendMessage(modified)
	end)
end

Features & Information

+Over 17 chat commands

Community Comments (7)

Joyful_PizzaPartylJoyful_PizzaPartylJan 26, 2026

I think they should SERIOUSLY add /n

Joyful_PizzaPartylJoyful_PizzaPartylJan 26, 2026

This is mine

squhzsquhzJan 26, 2026

Doesnt work

Replying to @squhz
Joyful_PizzaPartylJoyful_PizzaPartylJan 26, 2026

@squhz imma fix this soon but you should fix your lol

Replying to @Joyful_PizzaPartyl
Joyful_PizzaPartylJoyful_PizzaPartylJan 26, 2026

*too

Replying to @Joyful_PizzaPartyl
squhzsquhzJan 26, 2026

@Joyful_PizzaPartyl ive already attempted dw xD its cause the chat updated and the chat channel stuff like sending or reading off messages via scripts doesn't work anymore

Replying to @squhz
Joyful_PizzaPartylJoyful_PizzaPartylJan 27, 2026

@squhz BRUHH

More Scripts for Universal Scripts