if key == "v" do game.Workspace.USERNAME.Humaniod.Health=0 end
Because Humanoid is spelled wrong.
And without the rest of the script, this segment is useless. How do we know the rest of the script is okay?
Well first of all, what exactly is "key" Assuming "key" is a string value equal to "v" then the only thing wrong with this script is that Humanoid is spelled incorrectly.
Key has to have more code behind it I believe I haven't reached that yet. But its not if key == "v" I know its something like if keynumb = "7" or something then do it.
The syntax is messed up.
A. The syntax for an If Statement
is if true then code end
, you used 'do' there.
B. 'Humanoid' is spelled incorrectly.
C. Assuming that's the entire code, you don't have 'key' declared.
Assuming that is just a snippet of the code, 'key' is declared, etc., then this, theoretically, would work:
if key == "v" then game.Workspace["NAME HERE"].Humanoid.Health = 0 end
Hope this helped!