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

[Basic Scripting] Why doesn't this script detect a number change?

Asked by 3 years ago

local part = script.Parent local Health = part.Health

while true do if Health.Value <= 0 then print("Test") end wait() end

0
is "Health" a value instance or an attribute? AlexanderYar 788 — 3y
0
likely a value. Attributes would be fetched differently for some users. It is possible that the health could be changing from the client and this script could be a server script. greatneil80 2647 — 3y
0
well in that case, even though that script is pretty innifficient, it should work AlexanderYar 788 — 3y
0
Do some print debugging, print out Health.Value every iteration and see what the script sees. joshthegamer456 93 — 3y

Answer this question