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

How do you add a number to a Numbered Value?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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.

0
Yes but how do you add an number to it? so It will go up? kyanoke11 15 — 6y
Ad
Log in to vote
0
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
6 years ago

Try this:

Temp.Value = 0

while wait(2) do
       Temp.Value = Temp.Value + 3
end
Log in to vote
0
Answered by 6 years ago

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!

0
Yes But I need to transer it to an existing one, Like on the picture kyanoke11 15 — 6y
0
So do temp.Value = temp.Value + x you add how much you want BlackOrange3343 2676 — 6y

Answer this question