Hello,
How would I know if a NumberValue went smaller or bigger? I know I can use :GetPropertyChangedSignal(“Value”) but that does not tell me if the Value got bigger or smaller.
I don’t know what other informations to provide, sorry.
Thanks!
Hello,
How would I know if a NumberValue went smaller or bigger? I know I can use :GetPropertyChangedSignal(“Value”) but that does not tell me if the Value got bigger or smaller.
I don’t know what other informations to provide, sorry.
Thanks!
Idk maybe do this:
local startingValue = YourNumberValue
YourNumberValue:GetPropertyChangedSignal(“Value”):Connect(function()
if YourNumberValue.Value > startingValue.Value then -- the new value is greater than the starting value
--bigger
elseif YourNumberValue.Value < startingValue.Value then -- the new value is smaller than the starting value
--smaller
end
end)
something like this
local numberValue = -- where the number value is located
local value = numberValue.Value
NumberValue.Changed:Connect(function(newValue)
if newValue > value then
-- It is bigger
elseif newValue < value then
-- It is smaller
else
-- No change
end
value = newValue -- updates the value
end)
This won’t work, since .Changed goes for all properties so newValue won’t be a value…
Values have a modified changed event that only detects the Value being changed since it’s the only useful property