PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Changed

The Changed event fires whenever the NumberValue/Value of the NumberValue 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.

Note

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

Parameters

Name Type Default Description

The new value after the change.


Code Samples


NumberValue.Changed

The below example, assuming all referenced objects existed, would print the NumberValue’s new value each time it changed. In the example below it would print 20.

Workspace.NumberValue.Changed:Connect(function(NewValue)
    print(NewValue)
end)

Workspace.NumberValue.Value = 20