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.

3 comments
That does work, and I appreciate you help, but how could I make it so that "lom" would work the same, but "123" would return nil. This is so that if someone said "kill/p", it wouldn't just kill the first person with p in their name. It would kill the person who's name starts with p.
Edited to work like that
Thank you!