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

Why doesn't this work? Why isn't there an output?

Asked by 9 years ago

I have a script, it repeats, but i am not getting ANY output, and nothing is happening! Why not? Here is my script

repeat
    wait(0.5)
    print("waited")
    script.Parent.Value = script.Parent.Parent.Parent.Character.Player.Humanoid.Health
until 9 + 10 == 21

-EDIT- P.S this script is inside of a value, which is inside of the player

Please help! Thank you

0
Since it doesn't seem like you intend to stop the 'repeat' loop, try a 'while' loop instead. Redbullusa 1580 — 9y
0
If the Script is inside the 'Value' type instance, which is Parented to the 'Player', then it would be 'script.Parent.Parent.Character', also, it may be because the Script may be Disabled, that could be why your not receiving Output. TheeDeathCaster 2368 — 9y

2 answers

Log in to vote
0
Answered by
parkderp1 105
9 years ago

Where inside of the player?

Ad
Log in to vote
0
Answered by 9 years ago

**Note: **You don't need to do repeat wait until 9 + 10 == 21 to make something run forever, rather do:

while wait(0.5) do

end

Is your script inside of a NumberValue, if so, try putting it somewhere else, or switch it so the script is the parent of the numbervalue.

Since this question is quite vague, I hope I did my best to answer it, but what is the three "Parent.Parent.Parent", it would be nice if you could show us some hichery.

Answer this question