Hey guys! I'm currently experiencing and issue in where my admin script that i'm using to parse the text isn't working even though the Args doesn't match the command. Here's the script
local function Parse(Text)
print("At the start")
local args = Text:split(" ")
print(args[1])
print(args[2])
print(args[3])
if args[1] == "kill" or "Kill" then
print("Kill")
if game.Players:FindFirstChild(args[2]) then
game.Players:FindFirstChild(args[2]).Character.Humanoid.Health = 0
Output.Text = ("Killed "..tostring(args[2]))
Passed()
else
Output.Text = ("Player Not Found, "..tostring(args[2]))
Failed()
end
elseif args[1] == "Speed" or "speed" or "Walkspeed" or "walkspeed" or "WalkSpeed" then
if game.Players:FindFirstChild(args[2]) then
if args[3] then
print("Speed")
game.Players:FindFirstChild(args[2]).Character.Humanoid.WalkSpeed = tonumber(args[3])
Passed()
else
Output.Text = ("Invalid Argument, "..tostring(args[3]))
Failed()
end
else
Output.Text = ("Player Not Found, "..tostring(args[2]))
Failed()
end
end
end
When i use the kill command, it works just fine. However, when i use the speed command it plays the kill command instead. Everything prints correctly. When i use the print command it prints "Speed" then "Kill" and kills me. Anyone know why its looping back to kill? It only prints at the start once, and not again when i do the speed command (which kills me)
