Property: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Flurite
No edit summary
>Flurite
No edit summary
(No difference)

Revision as of 22:28, 28 December 2011

A property is a 'member' of an object, and decide various factors of the object. Like various substances in science, various objects can have different properties. Properties are 'owned' by an object, and you reference them as you would a table. Common properties that are in most objects include 'Parent' and 'Name'. Properties can be various types of data, such as a number (e.g. 'Value' property of a NumberValue), string (e.g. 'Name' property of a Part), boolean ('Visible' property of a TextLabel, and all the various data types. Properties serve various purposes, some which you can see in-games (such as Size and Position) and are used as reference (such as the values in a NumberValue or BooleanValue). You can access a property similarly to accessing a child, by using a period. This is an example of setting the name of a part to "LOLBrick".

part = game.Workspace.Part

part.Name = "LOLBrick" 
--notice how I use the '.' character and then 'Name', which is the property that changes the name of the object, to travel to the property.

Properties should not be confused with Children, which are objects nested within another object, such as parts in a model.

Properties can be changed or read using the Object Browser, the Properties tab in Studio, or by looking up the object on this wiki.