local InnerValue = script:FindFirstAncestorWhichIsA("ValueBase")
local OuterValue = InnerValue:FindFirstAncestorWhichIsA("ValueBase")
while true do
task.wait(0.25)
if OuterValue.Value > 4500 then
InnerValue.Value -= 0.1
end
end
If this doesn’t work then you’ve setup something incorrectly on your end, perhaps share a screenshot of your instance hierarchy so that we can get a better understanding of how everything is organised.
Are you sure the script parent value even has a near value altogether?
To me, it sounds like the game automatically nullified the while true do as a defense mechanism. There’s this defense mechanism that the game has where if you type
repeat
print("permatrago")
--wait() I'm too cool to be waiting B)
until nil
the game instead of crashing now breaks the loop when it has a overload.
And because this is adding a value up every 25 miliseconds, I assume it did the same.
METHOD1:
while script.Parent.Parent.Value > 4500 do
script.Parent.Value -= 0.1
wait(0.25)
end
METHOD2:
while true do
if script.Parent.Parent.Value > 4500 then
script.Parent.Value -= 0.1
else
break
end
wait(0.25)
end
The problem: While true do/while wait() do literally means for the loop to run infinitely/until it breaks
Also, using while loops outside of very specific situations is a bad practice. In this case I believe it’s ok but I recommend you take a look at the task scheduler