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

How do you get a number value's starting value after changing it's value?

Asked by 9 years ago

Whats the best way to get back a number value's starting number after changing the number value?

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

When you set a value, the previous value is lost.

If you don't want to lose the previous value, you should save it somewhere (probably a variable).

E.g.

local previous = value.Value
value.Value = 5
-- Change it temporarily to 5
wait(5)
value.Value = previous
-- Restore it to how it was
Ad

Answer this question