User:Realjame/Class Reference: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
No edit summary
m Move special part types to Internal section because they are broken and unusable in Studio
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
{{WIP}}
{{CatUp|Lua Help}}
{{CatUp|Lua Help}}


(Currently stolen from the 2014 Wiki, should rewrite.)
The Roblox Legacy Documentation features an API Reference that documents all of the classes, data types, enumerations, functions, events, callbacks, and properties that can be used to create games on classic Roblox.


The following is documentation for specific ROBLOX Lua classes.
* This page, the Class Reference, documents classes. Classes are core objects and services in Roblox's engine. Classes contain properties, methods, events and callbacks.
* [[Data_Types|Data Types]] are types unique to the Roblox engine, They can contain constructors, properties, and methods.
* [[:Category:Enums|Enums]] are groups of constants that define preset values that you can use with other APIs. Documentation for the generic Enumeration data type is [[Enumeration|here.]]
* [[Function_Dump|Globals]] are functions or properties that you can use in any script. Most globals are native to the Lua programming language while some are exclusive to Roblox's implementation.


Classes that are listed here can be created using the Instance.new constructor. However, there are several exceptions, which you should be aware of.
If you are looking for more information on undocumented API features, one of your best resources is the Object Browser pane (under the Help menu in Roblox Studio). There are also <b>so many</b> more objects used internally by the game engine which has not yet been added to the list here. If it has documentation on the wiki, it can be found at the [[:Category:ROBLOX_Lua_Objects]] category.
 
Roblox's API also has several built-in data types, which can be viewed on this page. Almost all of the classes here make use of these data types, such as the Position property of a Part icon.pngPart, which uses the Vector3 data type.
 
If you are looking for information on undocumented classes, one of your best resources is the Object Browser pane (under the Help menu in Roblox Studio). Alternatively, you could look through the API dump itself.
 
All Game objects are based on Instance and have the "global" methods, properties, and events defined there. Additionally, some classes derive from others, in a hierarchical tree-like structure, shown on the left.
 
All properties, methods, events and their arguments, in both this reference and the Object Browser are described using C syntax - their type is written before their name. For example, in this definition of a method:
 
Instance LoadAsset(int assetId)
 
Instance is the type of value returned by the method
LoadAsset is the name of the method
int is the type of the first parameter
assetId is the name of the first parameter
 
In addition to the functions and members listed here, ROBLOX exposes many standard and custom Lua functions. Please see the Function dump for a complete list of all global functions and members.


=Parts=
=Parts=
Line 31: Line 17:
* {{ClassRefItem|Part}}
* {{ClassRefItem|Part}}
* {{ClassRefItem|CornerWedgePart}}
* {{ClassRefItem|CornerWedgePart}}
* {{ClassRefItem|SkateboardPlatform}}
* {{ClassRefItem|TrussPart}}
* {{ClassRefItem|TrussPart}}
* {{ClassRefItem|FlagStand}}
* {{ClassRefItem|Platform}}
* {{ClassRefItem|Seat}}
* {{ClassRefItem|Seat}}
* {{ClassRefItem|VehicleSeat}}
* {{ClassRefItem|VehicleSeat}}
* {{ClassRefItem|SkateboardPlatform}}
* {{ClassRefItem|SkateboardPlatform|late=true}}
* [[File:Spawnlocation icon.png]][[RBX.lua.SpawnLocation_(Object)|SpawnLocation]]
* [[File:Spawnlocation icon.png]][[RBX.lua.SpawnLocation_(Object)|SpawnLocation]]
* {{ClassRefItem|Terrain}}
* {{ClassRefItem|Terrain|late=true}}


=Part modifiers=
=Part modifiers=
Line 42: Line 31:
These objects, when parented to a part, will change the appearance or behavior of the part.
These objects, when parented to a part, will change the appearance or behavior of the part.


 
* {{ClassRefItem|BlockMesh}}
 
* {{ClassRefItem|ClickDetector}}
* {{ClassRefItem|CylinderMesh}}
* {{ClassRefItem|Decal}}
* {{ClassRefItem|FileMesh}}
* {{ClassRefItem|Fire}}
* {{ClassRefItem|Hole}}
* {{ClassRefItem|Smoke}}
* {{ClassRefItem|Sparkles}}
* {{ClassRefItem|SpecialMesh}}
* {{ClassRefItem|Texture}}
=Body movers=
=Body movers=


Similar to part modifiers, these objects work on the part they are parented to. These objects alter the position, orientation, or movement of a part. All classes here inherit from the BodyMover abstract class.
Similar to part modifiers, these objects work on the part they are parented to. These objects alter the position, orientation, or movement of a part. All classes here inherit from the BodyMover abstract class.


* {{ClassRefItem|BodyAngularVelocity}}
* {{ClassRefItem|BodyForce}}
* {{ClassRefItem|BodyGyro}}
* {{ClassRefItem|BodyPosition}}
* {{ClassRefItem|BodyThrust}}
* {{ClassRefItem|BodyVelocity}}
* {{ClassRefItem|RocketPropulsion}}
=Gameplay=
=Gameplay=


These objects are used in general gameplay of a place.
These objects are used in general gameplay of a place.


* {{ClassRefItem|Camera}}
* {{ClassRefItem|Controller|early=true}}
* {{ClassRefItem|Dialog|late=true}}
* {{ClassRefItem|DialogChoice|late=true}}
* {{ClassRefItem|Explosion}}
* {{ClassRefItem|Flag}}
* {{ClassRefItem|Hint}}
* {{ClassRefItem|HopperBin}}
* {{ClassRefItem|Message}}
* {{ClassRefItem|Player}}
* {{ClassRefItem|Sky}}
* {{ClassRefItem|Sound}}
* {{ClassRefItem|StockSound}}
* {{ClassRefItem|Tool}}
=Humanoids=
=Humanoids=


These objects are usually found in Humanoids. An example is a Player's Character.
These objects are usually found in Humanoids. An example is a Player's Character.


* {{ClassRefItem|Humanoid}}
* {{ClassRefItem|Accoutrement}}
* {{ClassRefItem|Animation}}
* {{ClassRefItem|AnimationTrack}}
* {{ClassRefItem|BodyColors}}
* {{ClassRefItem|ForceField}}
* {{ClassRefItem|Hat}}
* {{ClassRefItem|Keyframe}}
* {{ClassRefItem|Pants}}
* {{ClassRefItem|Pose}}
* {{ClassRefItem|Shirt}}
* {{ClassRefItem|ShirtGraphic}}
* {{ClassRefItem|Skin}}
=GUI=
=GUI=


These objects display graphical elements in 2-dimensional space on the player's screen, in front of the 3D world.
These objects display graphical elements in 2-dimensional space on the player's screen, in front of the 3D world.


* {{ClassRefItem|ScreenGui}}
* {{ClassRefItem|Frame}}
* {{ClassRefItem|ImageButton}}
* {{ClassRefItem|ImageLabel}}
* {{ClassRefItem|NotificationBox}}
* {{ClassRefItem|TextBox}}
* {{ClassRefItem|TextButton}}
* {{ClassRefItem|TextLabel}}
* {{ClassRefItem|GuiMain}}
=3D GUI=
=3D GUI=


These objects display graphical elements in 3-dimensional space. While they don't interact physically with parts, they are usually attached to parts in some way.
These objects display graphical elements in 3-dimensional space. While they don't interact physically with parts, they are usually attached to parts in some way.


* {{ClassRefItem|ArcHandles}}
* {{ClassRefItem|BillboardGui}}
* {{ClassRefItem|Handles}}
* {{ClassRefItem|SelectionBox}}
* {{ClassRefItem|SelectionPartLasso}}
* {{ClassRefItem|SelectionPointLasso}}
* {{ClassRefItem|SurfaceSelection}}
=Scripting=
=Scripting=


These objects are involved in adding scripted functionality to a game.
These objects are involved in adding scripted functionality to a game.


* {{ClassRefItem|Script}}
* {{ClassRefItem|LocalScript}}
* {{ClassRefItem|BindableEvent|late=true}}
* {{ClassRefItem|BindableFunction|late=true}}
* {{ClassRefItem|Plugin|late=true}}
* {{ClassRefItem|PluginManager|late=true}}
* {{ClassRefItem|PluginMouse|late=true}}
=Values=
=Values=


These objects exist to hold specific value types. They are essential for communicating data between Scripts.
These objects exist to hold specific value types. They are essential for communicating data between Scripts.


* {{ClassRefItem|BoolValue}}
* {{ClassRefItem|BrickColorValue}}
* {{ClassRefItem|Color3Value}}
* {{ClassRefItem|CFrameValue}}
* {{ClassRefItem|NumberValue}}
* {{ClassRefItem|ObjectValue}}
* {{ClassRefItem|RayValue}}
* {{ClassRefItem|StringValue}}
* {{ClassRefItem|Vector3Value}}
=Joints=
=Joints=


These objects bind parts together, sometimes with an extra effect such as a hinge or motor. All classes here inherit from the JointInstance abstract class.
These objects bind parts together, sometimes with an extra effect such as a hinge or motor. All classes here inherit from the JointInstance abstract class.


* {{ClassRefItem|Glue}}
* {{ClassRefItem|Motor}}
* {{ClassRefItem|MotorFeature}}
* {{ClassRefItem|Motor6D}}
* {{ClassRefItem|Rotate}}
* {{ClassRefItem|RotateP}}
* {{ClassRefItem|RotateV}}
* {{ClassRefItem|Snap}}
* {{ClassRefItem|VelocityMotor}}
* {{ClassRefItem|Weld}}
=Containers=
=Containers=


These objects are designed to contain other objects as children. For example, the Workspace holds objects that are simulated as the game runs.
These objects are designed to contain other objects as children. For example, the Workspace holds objects that are simulated as the game runs.


* {{ClassRefItem|Backpack}}
* {{ClassRefItem|Configuration}}
* {{ClassRefItem|DataModel}}
* {{ClassRefItem|PlayerGui}}
* {{ClassRefItem|StarterGear}}
* {{ClassRefItem|StarterGui}}
* {{ClassRefItem|Teams}}
=Services=
=Services=


These objects generally operate in the background, and may be helpful with place development. They're unique in that they may only have one instance of themselves, and can be acquired with the GetService method.
These objects generally operate in the background, and may be helpful with place development. They're unique in that they may only have one instance of themselves, and can be acquired with the GetService method.
* {{ClassRefItem|BadgeService}}
* {{ClassRefItem|Debris}}
* {{ClassRefItem|HtmlService|early=true}}
* {{ClassRefItem|InsertService}}
* {{ClassRefItem|Lighting}}
* {{ClassRefItem|StarterPack}}
* {{ClassRefItem|Players}}
* {{ClassRefItem|ScriptContext}}
* {{ClassRefItem|SoundService}}
* {{ClassRefItem|Teams}}
* {{ClassRefItem|TeleportService|late=true}}
* {{ClassRefItem|Timer}}
* {{ClassRefItem|Workspace}}
=Internal=
These objects are used internally by the game engine. Generally, trying to use them in Scripts or LocalScripts will result in an error. However, [[Plugin|Plugins]] and the Command Bar in Studio may use them. They might come in handy for making [[How_To_Make_Plugins|Plugins]] to enhance your Studio workflow.
==Structural Classes==
[[Structural_Class|Structural Classes]], or "superclasses", are objects which can't be created or used with Instance.new in game, but are the basis for other objects to inherit properties, events, and methods. For example, {{ClassRefItem|Part}}, {{ClassRefItem|TrussPart}}, and {{ClassRefItem|WedgePart}} all inherit from the structural class {{ClassRefItem|BasePart}}.
Essentially, they're used for creating objects that are mostly similar, but slightly diverge, such as a Part and TrussPart. They both require the same properties and methods but their physical appearance and functionality diverge.
* {{ClassRefItem|Instance}}
* {{ClassRefItem|Accoutrement}}
* {{ClassRefItem|BackpackItem}}
* {{ClassRefItem|BasePart}}
* {{ClassRefItem|BasePlayerGui}}
* {{ClassRefItem|Clothing}}
* {{ClassRefItem|ControllerService|early=true}}
* {{ClassRefItem|Feature}}
* {{ClassRefItem|FormFactorPart}}
* {{ClassRefItem|GuiBase}}
* {{ClassRefItem|GuiButton}}
* {{ClassRefItem|GuiLabel}}
* {{ClassRefItem|GuiObject}}
* {{ClassRefItem|JointInstance}}
* {{ClassRefItem|NetworkPeer}}
* {{ClassRefItem|PVAdornment}}
* {{ClassRefItem|PVInstance}}
* {{ClassRefItem|ReflectionMetadataItem}}
* {{ClassRefItem|ROOT}}
* {{ClassRefItem|StatsItem}}
==Objects==
* {{ClassRefItem|AnimationTrackState}}
* {{ClassRefItem|AutoJoint}}
* {{ClassRefItem|HumanoidController}}
* {{ClassRefItem|LocalBackpack}}
* {{ClassRefItem|LocalBackpackItem}}
* {{ClassRefItem|Mouse}}
* {{ClassRefItem|NetworkClient}}
* {{ClassRefItem|NetworkMarker}}
* {{ClassRefItem|NetworkReplicator}}
* {{ClassRefItem|NetworkServer}}
* {{ClassRefItem|NetworkSettings}}
* {{ClassRefItem|PrismPart}}
* {{ClassRefItem|PyramidPart}}
* {{ClassRefItem|RightAngleRampPart}}
* {{ClassRefItem|ReflectionMetadataMember}}
* {{ClassRefItem|RunningAverageItemDouble}}
* {{ClassRefItem|Stats}}
* {{ClassRefItem|TextureTrail}}
* {{ClassRefItem|TouchTransmitter}}
* {{ClassRefItem|VirtualUser}}
==Services==
* {{ClassRefItem|ChangeHistoryService}}
* {{ClassRefItem|CollectionService}}
* {{ClassRefItem|ContentProvider}}
* {{ClassRefItem|CoreGui}}
* {{ClassRefItem|FlagStandService}}
* {{ClassRefItem|FriendService}}
* {{ClassRefItem|Geometry}}
* {{ClassRefItem|GuidRegistryService}}
* {{ClassRefItem|GuiService}}
* {{ClassRefItem|KeyframeSequenceProvider}}
* {{ClassRefItem|MeshService}}
* {{ClassRefItem|PhysicsService}}
* {{ClassRefItem|RenderHooksService}}
* {{ClassRefItem|RunService}}
* {{ClassRefItem|Selection}}
* {{ClassRefItem|SocialService}}
* {{ClassRefItem|SpawnerService}}
* {{ClassRefItem|TestService}}
* {{ClassRefItem|TextService}}
* {{ClassRefItem|TextureContentProvider}}
* {{ClassRefItem|TweenService}}
==Studio==
Some classes are used directly by Studio, but others can be used by Studio plugins to analyze properties of the game engine, hardware, and more.
* {{ClassRefItem|DebugSettings}}
* {{ClassRefItem|FastLogSettings}}
* {{ClassRefItem|FunctionalTest}}
* {{ClassRefItem|GlobalSettings}}
* {{ClassRefItem|StudioSettings}}
* {{ClassRefItem|LuaSettings}}
* {{ClassRefItem|ProfilingItem}}
* {{ClassRefItem|PseudoPlayer}}
* {{ClassRefItem|RenderSettings}}
* {{ClassRefItem|StudioTool}}


[[Category:Reference Pages]]
[[Category:Reference Pages]]

Latest revision as of 14:09, 8 May 2023

Work In Progress
This is currently being worked on! Check back later for more information... hopefully.


The Roblox Legacy Documentation features an API Reference that documents all of the classes, data types, enumerations, functions, events, callbacks, and properties that can be used to create games on classic Roblox.

  • This page, the Class Reference, documents classes. Classes are core objects and services in Roblox's engine. Classes contain properties, methods, events and callbacks.
  • Data Types are types unique to the Roblox engine, They can contain constructors, properties, and methods.
  • Enums are groups of constants that define preset values that you can use with other APIs. Documentation for the generic Enumeration data type is here.
  • Globals are functions or properties that you can use in any script. Most globals are native to the Lua programming language while some are exclusive to Roblox's implementation.

If you are looking for more information on undocumented API features, one of your best resources is the Object Browser pane (under the Help menu in Roblox Studio). There are also so many more objects used internally by the game engine which has not yet been added to the list here. If it has documentation on the wiki, it can be found at the Category:ROBLOX_Lua_Objects category.

Parts

As the essential building blocks of Roblox, these objects interact with each other physically. All classes here inherit from the BasePart abstract class.There parts all all rendered in 3D if placed in workspace.


Part modifiers

These objects, when parented to a part, will change the appearance or behavior of the part.

Body movers

Similar to part modifiers, these objects work on the part they are parented to. These objects alter the position, orientation, or movement of a part. All classes here inherit from the BodyMover abstract class.

Gameplay

These objects are used in general gameplay of a place.

Humanoids

These objects are usually found in Humanoids. An example is a Player's Character.

GUI

These objects display graphical elements in 2-dimensional space on the player's screen, in front of the 3D world.

3D GUI

These objects display graphical elements in 3-dimensional space. While they don't interact physically with parts, they are usually attached to parts in some way.

Scripting

These objects are involved in adding scripted functionality to a game.

Values

These objects exist to hold specific value types. They are essential for communicating data between Scripts.

Joints

These objects bind parts together, sometimes with an extra effect such as a hinge or motor. All classes here inherit from the JointInstance abstract class.

Containers

These objects are designed to contain other objects as children. For example, the Workspace holds objects that are simulated as the game runs.

Services

These objects generally operate in the background, and may be helpful with place development. They're unique in that they may only have one instance of themselves, and can be acquired with the GetService method.

Internal

These objects are used internally by the game engine. Generally, trying to use them in Scripts or LocalScripts will result in an error. However, Plugins and the Command Bar in Studio may use them. They might come in handy for making Plugins to enhance your Studio workflow.

Structural Classes

Structural Classes, or "superclasses", are objects which can't be created or used with Instance.new in game, but are the basis for other objects to inherit properties, events, and methods. For example, Part , TrussPart , and WedgePart

all inherit from the structural class BasePart

.

Essentially, they're used for creating objects that are mostly similar, but slightly diverge, such as a Part and TrussPart. They both require the same properties and methods but their physical appearance and functionality diverge.

Objects

Services

Studio

Some classes are used directly by Studio, but others can be used by Studio plugins to analyze properties of the game engine, hardware, and more.