Changed (Event)/property: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Trappingnoobs
removed category methods
>JulienDethurens
Believe it or not, 'Property' is actually a real type. The object browser says so...
Line 1: Line 1:
<onlyinclude>{{Event
<onlyinclude>{{Event
|name = Changed
|name = Changed
|arguments = [[String]] ''Property''
|arguments = [[Property]] <var>property</var>
|description = Fired after the specified property is changed.
|description = Fired whenever a property of the object changes.
|object = Instance
|object = Instance
}}</onlyinclude>
}}</onlyinclude>
Line 8: Line 8:
{{clear floats}}
{{clear floats}}


{{Example|<pre>
{{Example|
local function wChange(prop)
This code would print the value of each property of the Workspace, as well as its name, whenever it is changed:
  print(prop) --most likely DistributedGameTime
<code lua>
end
Workspace.Changed:connect(function(property)
game.Workspace.Changed:connect(wChange)
print(property .. ": ", Workspace[property])
</pre>}}
end)
</code>}}

Revision as of 05:36, 6 February 2012

Changed ( Property property )
Description Fired whenever a property of the object changes.
Member of: Instance


Example

This code would print the value of each property of the Workspace, as well as its name, whenever it is changed: Workspace.Changed:connect(function(property) print(property .. ": ", Workspace[property]) end)