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

Please help me with checking if a numberValue has changed every .1 second?

Asked by 9 years ago

I really need help with this. I tried this:

v = script.Parent.Parent.Amount
while wait(0.1) do
script.Parent.Text = (v.Value)
end

It's supposed to check a numberValue ("Amount") every 0.1 second, but it doesn't refresh to check. Can somebody please help me?

2 answers

Log in to vote
2
Answered by 9 years ago

You can use the .Changed event instead, it would work much more efficiently.

v = script.Parent.Parent.Amount

v.Changed:connect(function()
    script.Parent.Text = v.Value
end)
Ad
Log in to vote
0
Answered by 9 years ago
v = script.Parent.Parent.Amount
while wait(0.1) do
script.Parent.Text = ""..v.Value..""
end

This needs to be in a string, so just do it this way and it should work. You just had a slight mistake.

Answer this question