Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to subtract the value on a IntValue?

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?

3 comments

0

'Bricks' is a IntValue, if yeah its: script.Parent.Bricks.Value = script.Parent.Bricks.Value - 1

0

Oh lol

0

Also, you could have put that in the same script using coroutines. :P

1 answer

It's a common mistake, here:

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

This discussion is preserved as it was. New answers, comments, and votes are closed.