PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

GetPropertyChangedSignal

This method returns an event that behaves exactly like the Changed event, except that the event only fires when the given property changes. It’s generally a good idea to use this method instead of a connection to Changed with a function that checks the property name. Subsequent calls to this method on the same object with the same property name return the same event.

print(object:GetPropertyChangedSignal("Name") == object:GetPropertyChangedSignal("Name")) --> always true

ValueBase objects, such as IntValue and StringValue, use a modified Changed event that fires with the contents of the Value property. As such, this method provides a way to detect changes in other properties of those objects. For example, to detect changes in the Name property of an IntValue, use IntValue:GetPropertyChangedSignal("Name"):Connect(someFunc) since the Changed event of IntValue objects only detect changes on the Value property.

Parameters

Name Type Default Description

Returns

Return Type Summary

Code Samples


Changed and GetPropertyChangedSignal

This code sample demonstrates the equivalence of the Changed event and event returned by GetPropertyChangedSignal.


Old-to-New Values with Changed

This code sample demonstrates how to save a value before a changed event fires on it in order to get more information about a change.