The message to be formatted correctly.
The text becomes html type code.
Rerunning the script.
This is what the text looks like:
Here is my code:
Server Command Processor
local security = require(script.Parent.Security)
return function(runner, message, prefix)
if string.sub(message, 1, 1) == prefix then
local command = string.split(message, " ")[1]:sub(2)
local Arguments = {}
for i,v in pairs(string.split(message, " ")) do
if i ~= 1 then
table.insert(Arguments, v)
end
end
for _,str in ipairs(Arguments) do
if str == "" or str == nil then
table.remove(Arguments, table.find(Arguments, str))
end
end
for _,data in ipairs(require(script.Parent.Commands)) do
if data.Command:lower() == command:lower() then
if security.hasPermission(runner, command) == true then
data.Run(runner, Arguments)
else
local perms = data.Permissions
local permTab = {}
for _,v in ipairs(perms) do if typeof(v) == "Instance" then table.insert(permTab, v.Name) else table.insert(permTab, v) if #permTab >= #perms then break end end end
game.ReplicatedStorage.Remotes.ChatSystemMessage:FireClient(runner, "<b> Unable to run ".. command.."! Missing permission(s): "..table.concat(permTab,", "))
end
end
end
end
end
Client Event Script
script = nil
local s, r = pcall(function()
game.ReplicatedStorage.Remotes.ChatSystemMessage.OnClientEvent:Connect(function(text)
warn("Received system message from server: " .. text)
for _,v in next,game.TextChatService:WaitForChild("TextChannels"):GetChildren() do
if v:IsA("TextChannel") then
v:DisplaySystemMessage(text)
break
end
end
end)
end)
if not s then
error(r)
else
warn("System message script loaded successfully")
end
local Commands = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Commands")
Commands.ToggleMarkers.OnClientEvent:Connect(function()
for _,v in next,workspace:WaitForChild("Markers"):GetChildren() do
if v:FindFirstChildOfClass("BillboardGui") then
v:FindFirstChildOfClass("BillboardGui").Enabled = not v:FindFirstChildOfClass("BillboardGui").Enabled
end
end
end)