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

How do you add a number to a Numbered Value?

So, I'm making my own Computer Core and I just don't get it. My temperature starts at '0' But I want it that it adds 3 to the temperature every 2 seconds. Like '0' then '3' then '6' ,...

Does anyone knows how to make this?

http://i63.tinypic.com/15x27vc.png

Thank You!

3 answers

You have to use the "Value" property on the object, so for instance your "Temp" numbervalue object has a Value in the properties. You use it in the script like this:

Temp.Value = 3

and if you want to compare it to something then you would use:

if Temp.Value > 30 then

end

and as far as waiting goes that is self explanatory, just use:

wait(2)

Hope this helps.

1 comment

0

Yes but how do you add an number to it? so It will go up?

Try this:

Temp.Value = 0

while wait(2) do
       Temp.Value = Temp.Value + 3
end

Your question has already been answered, if you still don't understand, you must take a value and add a value to the value.

in this example:

temp.Value = temp.Value + 3 

Not only you can add values by number values, you can also do this:

temp.Value = temp.Value + temp.Value

This here is the same as

temp.Value = temp.Value * 2

You see, to add values, all you have to do is do a operation in math and create and equation. Then, make sure you have your number value defined as a variable, and start adding!

Hope this helped! Good luck on your goal!

2 comments

0

Yes But I need to transer it to an existing one, Like on the picture

0

So do temp.Value = temp.Value + x you add how much you want

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