User:Legend26/Test

From Legacy Roblox Wiki
Revision as of 18:00, 17 February 2012 by >Legend26 (New enumeration page format - not done. So far I just basically copy/pasted it. Will finish later.)
Jump to navigationJump to search

An Enumeration, or Enum, is a type of data that represents a selection. For example, the SurfaceType Enum has different options for selecting what type of surface a brick has. Some of which are "Glue", "Hinge", and "Inlet". These are names on selection types. Here is a table of all the text values.

Methods

Enums also have a single method:

GetEnumItems( )
Returns Table enumItems
Description: Returns all the EnumItems in the Enum.
Member of: Enum



Usage

You can set an Enumerated property through Lua in the following three ways:

Example
To set the SurfaceType enum for RightSurface to Weld:

game.Workspace.Part.RightSurface = Enum.RightSurface.Weld -- or game.Workspace.Part.RightSurface = 2 -- setting it with the id of the enum value -- or game.Workspace.Part.RightSurface = "Weld" --Setting it with the name of the enum value