Changed (Event)/property: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
m Text replacement - "<code lua>" to "<SyntaxHighlight code="lua">"
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
Line 10: Line 10:
{{Example|
{{Example|
This code would print the value of each property of the Workspace, as well as its name, whenever it is changed:
This code would print the value of each property of the Workspace, as well as its name, whenever it is changed:
<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
Workspace.Changed:connect(function(property)
Workspace.Changed:connect(function(property)
print(property .. ": ", Workspace[property])
print(property .. ": ", Workspace[property])
end)
end)
</SyntaxHighlight>}}
</SyntaxHighlight>}}

Revision as of 06:02, 27 April 2023

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)