I want to make it so only a specific player can do this:
function chat(msg, sender)
local delimiter_point=msg:find("/", 1, true) --Find the delimiter in the string
if delimiter_point then --Make sure it's actually there
local command = msg:sub(1, delimiter_point-1)
local arg = msg:sub(delimiter_point+1)
--We have the command and argument. It's now time to start with the commands :D
if command == "message" then
local x = Instance.new("Message", Workspace) --Create a message
x.Text = arg --Set its text to the text after the delimiter
game.Debris:AddItem(x, 5) --Remove the message after five seconds.
elseif command == "kill" then
if game.Players:findFirstChild(arg) then --See if player is in game
local x = game.Players:findFirstChild(arg) -- Set a variable for the player found
if x.Character then --Make sure the player has a character so we can kill it
x.Character:BreakJoints() --If character found, then kill character.
end
end
end
end
end
game.Players.PlayerAdded:connect(function(plr)
repeat wait() until plr.Character
plr.Chatted:connect(function(msg)
chat(msg, plr)
end)
end)

2 comments
if sender ~= 'username' then return end
Try if plr.UserId == "Your UserId" then chat(msg, plr) end