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

How to subtract the value on a IntValue?

Asked by 9 years ago

Everytime i do this:

p = script.Parent.Bricks

while true do
wait(0.2)
script.Parent.Text = "There are" .. p.Value .. "% Of Bricks Left"
end

With another script:

while true do
wait(1)
script.Parent.Bricks.Value - 1
end

When i try to subtract the value it doesnt work! Am i doing something wrong?

0
'Bricks' is a IntValue, if yeah its: script.Parent.Bricks.Value = script.Parent.Bricks.Value - 1 XToonLinkX123 580 — 9y
0
Oh lol PixelZombieX 8 — 9y
0
Also, you could have put that in the same script using coroutines. :P Diitto 230 — 9y

1 answer

Log in to vote
0
Answered by
iFlusters 355 Moderation Voter
9 years ago

It's a common mistake, here:

while true do
wait(1)
script.Parent.Bricks.Value = script.Parent.Bricks.Value - 1
end
Ad

Answer this question