Property: Difference between revisions
>SoulStealer9875 Read-only |
>SoulStealer9875 Forgot something. |
||
Line 15: | Line 15: | ||
== Read-only Properties == | == Read-only Properties == | ||
There are some read-only properties such as [[ | There are some read-only properties such as [[Genre_(Property)]]. These properties cannot be edited. | ||
== Notes == | == Notes == | ||
* When requesting a child, the script will first check for the property, so don't name your brick 'Name' or any other property | * When requesting a child, the script will first check for the property, so don't name your brick 'Name' or any other property |
Revision as of 13:14, 9 April 2012
What is a property?
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. You can view a list of all properties here.
Read-only Properties
There are some read-only properties such as Genre_(Property). These properties cannot be edited.
Notes
- When requesting a child, the script will first check for the property, so don't name your brick 'Name' or any other property