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

How to get oldValue and newValue of IntValue changed?

IntValue = Instance.new("IntValue")
IntValue.Value = 5
wait(5) -- It changed, only after that "wait" you need check value
IntValue.Value = IntValue.Value + 3

Welp, you need to find how to print new and old value after it changed and print them both. Thanks you.

The answer probably will be like that:

5 8

1 answer

Okay, I already got the answer. I just need to save value after it gonna change

IntValue = Instance.new("IntValue")
IntValue.Value = 5
OldValue = IntValue.Value
wait(5) -- It changed, only after that "wait" you need check value
NewValue = IntValue.Value + 3
OldValue = NewValue
print(OldValue)
print(NewValue)

1 comment

0

you could also do IntValue.Changed

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