Script1
local prefix = "/" --The prefix that will be used
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg:sub(1,6) == prefix.."kill " then --The first example you gave this would be correct
local target = game.Players:FindFirstChild(msg:sub(7)) --There is another way to do this but this is the simplest way, but you need to find the player after the command was used. This is why sub will be used.
if target then --Check if the player is actually there
local char = target.Character --Make sure they have a character
if char then
char:FindFirstChild("Humanoid").Health = 0
end
end
end
end)
end)
Script2
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if message == ("/kill me") then
for i,v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid.Health = 0
end
end
end)
end)
Im trying to make it work even if u say like /KiLL Lolamtic or like /kill Lo or /KiLL LOLAmTic

1 comment
It will show an error and u ignored script 2