NumberValue.Changed

This event fires whenever the NumberValue.Value property is changed.

This event, like other changed events, can be used to track when an NumberValue changes and to track the different values that it may change to.

For instance, this even may be useful in games that rely on NumberValues to track game states and values, such as item IDs.

Equivalent changed events exist for similar objects, such as ObjectValue and StringValue, depending on what object type best suits the need.

Parameters

value: number

The value after the change.


Code Samples

This example prints the NumberValue's new value each time it changes. Here it prints 20.

NumberValue Changed

local numberValue = script.Parent.NumberValue
local function printValue(value)
print(value)
end
numberValue.Changed:Connect(printValue)
numberValue.Value = 20