Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why won't this work?

Asked by 10 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.
if key == "v" do
game.Workspace.USERNAME.Humaniod.Health=0
end
0
If this is all of the code, it is invalid in so many ways. Oh, and also 'Humanoid' is spelled incorrectly. systematicaddict 295 — 10y

4 answers

Log in to vote
0
Answered by 10 years ago

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?

Ad
Log in to vote
0
Answered by
jav2612 180
10 years ago

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.

Log in to vote
0
Answered by 10 years ago

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.

Log in to vote
0
Answered by 10 years ago

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!

Answer this question