So in admin commands, you can type something like ":kill pla" and it would kill someone named "Player" how can I do this?
This is my script: (any help appreciated as usual)
local a = false
local oa = false
local pref = "."
local owners = {"Hyphonated", "Player"}
local admins = {"", ""}
game.Players.PlayerAdded:connect(function(p)
for _,owner in pairs(owners) do
if p.Name == owner then
oa = true
a = true
print(oa, a)
end
end
end)
game.Players.PlayerAdded:connect(function(p)
for _,admin in pairs(admins) do
if p.Name == admin then
a = true
end
end
end)
game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
if string.sub(msg, string.len(pref), 6) == pref.."kill " and a == true then
if game.Players:FindFirstChild(string.sub(msg, 7, string.len(msg))) then
game.Players:FindFirstChild(string.sub(msg, 7, string.len(msg))).Character.Humanoid.Health = 0
end
end
end)
end)
