I know how to do all but one thing.
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if msg:sub(1,5) == "kill/" then local killedPlr = game.Players:FindFirstChild(msg:sub(6)) if killedPlr then killedPlr.Character.Humanoid.Health = 0 end end end) end)
The only thing I do not know how to do is make it so that it is possible to abbreviate the player's name. I would appreciate help with this.
Given an array of strings, we can get the element that matches
strings = {"lombardo2", "applepie", "pawner123", "pizzadude24", "Apatheia"} function getStringThatMatch(t, p) for k, v in next, t do if v:match("^"..p) then return v end end return nil end print(getStringThatMatch(strings, "lom"), getStringThatMatch(strings, "123"))
If you mean like Admin Commands, then;
--Kind of edited your script local Admins = {"Perci1","bestfriend","friend"} --Add names here game.Players.PlayerAdded:connect(function(plr) --Player Added event for i,v in pairs(Admins)do --For loop for Admins if plr.Name:lower()==v:lower()then --If plr's Name matches to Admins then plr.Chatted:connect(function(msg) --Player chatted if msg:sub(1,5) == "kill/" then --If the command starts will 'kill/' then local killedPlr = game.Players:GetChildren() --Gets the Children of game.Players for i, v in pairs(killedPlr)do --For look for game.Players if v:IsA("Player")then --If is a Player if v and v.Name:lower()==msg:sub(6) and v.Character then --If player, player's Character exists, and player's Name matches then v.Character:BreakJoints() --Kills player end end end end end)end end end) --All the ends
I hope this helped!