Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't this work?

if key == "v" do
game.Workspace.USERNAME.Humaniod.Health=0
end

1 comment

0

If this is all of the code, it is invalid in so many ways. Oh, and also 'Humanoid' is spelled incorrectly.

4 answers

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.