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)
game.Players.PlayerAdded:Connect(function(plr) -- THIS EVENT RUNS WHEN A PLAYER IS ADDED TO THE GAME if plr.UserId == 000000000 then --CHECKS THE USER ID OF THE PLAYER [REPLACE 000000000 WITH THE USER'S ID] --THE SCRIPT YOU PUT HERE WILL RUN ONLY IF THE PLAYER'S USER ID IS THE SET USER ID end end)