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

How to get oldValue and newValue of IntValue changed?

Asked by 4 years ago
Edited 4 years ago
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

Log in to vote
1
Answered by 4 years ago

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)
0
you could also do IntValue.Changed MmadProgrammer 35 — 4y
Ad

Answer this question