Reference¶
Every system, class, type and function a Luau script can use.
Systems¶
Engine systems every script can use by name, such as World and Physics.
| Name | Summary |
|---|---|
| Animation | Animation has the numbers scripts need to write a character's Animator.Layers: the first layer scripts may write and the limb mask flags. |
| Audio | Audio plays one-shot 2D and 3D sounds, controls mixer bus volumes, and sets how loud touching parts sound. |
| Chat | Chat sends player chat messages, posts system announcements, shows chat bubbles, runs server slash commands and delivery filters, and fires signals when chat events arrive. |
| CloudStore | CloudStore saves player data in the cloud, where every server of the place can read it. |
| Content | Content downloads published assets by id, spawns downloaded scenes, and looks up player avatars and headshots. |
| Csg | Csg combines parts into one solid shape, called a union, and takes unions apart again. |
| Emoji | Emoji looks up the built-in emojis by shortcode, picker category, and search words. |
| Input | Input reads the local player's keyboard, mouse, gamepad, touch, and VR controller input and sets the cursor and UI selection. |
| Locale | Locale gets and sets the place's language, loads in-memory place translations, and formats translated strings. |
| Marketplace | Marketplace sells the products of your place for Lunes, the platform currency. |
| Materials | Materials lists, reads, defines, and removes the surface materials of a place. |
| Net | Net declares typed client-server messages and sends them between players and the server. |
| Particles | Particles provides one-shot particle spawning, the built-in Sparks preset, and platform texture ids. |
| Physics | Physics has the place-wide simulation settings, the collision groups, and the spatial queries against collider shapes. |
| Players | Players looks up connected players and their characters, checks admin status, and disconnects players. |
| Prefabs | Prefabs spawns copies of prefabs, inspects which prefab an entity came from, and resets edited copies back to their prefab defaults. |
| Profiler | Profiler reads frame times, script times, system times, and custom scope times on the machine that runs the script. |
| Settings | Settings reads the player's keybinds and device settings from the client settings menu, and reports when the core menu opens or closes. |
| Store | Store saves values by key so they survive a server restart. |
| Trails | Trails draws short-lived beam and bullet trail segments between two world positions. |
| Tween | Tween animates entity or world properties from their current values to target values over time. |
| VR | VR reads headset and motion controller poses, velocities, analog inputs, and session state on the local client, and queues controller haptics and play-space recentering. |
| World | World is the top of the place's tree of parts and entities. |
Classes¶
Entity classes and what every entity has.
| Name | Summary |
|---|---|
| Ambient | Ambient controls the world's ambient illumination that fills shadows and surfaces no direct light reaches. |
| Attachment | Attachment marks either a socket on a character or the root of an accessory that snaps into a matching socket. |
| BillboardGui | BillboardGui anchors a 2D UI canvas to a 3D world entity so it always faces the camera. |
| Body | Body configures how an entity simulates under physics: motion mode, damping, gravity scaling, axis locks, mass, sleep state, and force or impulse methods. |
| CameraLens | CameraLens configures a camera entity's perspective field of view, clip planes, render layer cull mask, and optional oblique clip plane. |
| CameraOrbit | CameraOrbit drives a third-person orbit camera around Subject with mouse, touch, and stick steering, zoom bounds, wall collision avoidance, and subject proximity fade. |
| CharacterAppearance | CharacterAppearance overrides a character's body meshes, face and clothing textures, and limb colors. |
| Clouds | Clouds controls the world's volumetric cloud layer, drawn over the sky and lit by the sun. |
| Collider | Collider defines the collision shape, trigger behavior, physical surface overrides, assembly membership, and contact signals of an entity. |
| CsgCombiner | CsgCombiner combines child parts into one union or intersection that Csg creates. |
| Entity | Entity is a node in the scene tree: a part, a light, a sound, a character or a user interface element. |
| Exposure | Exposure sets the lower and upper exposure value bounds for automatic exposure. |
| Flare | Flare controls the world's sun lens flare and sun rays. |
| Fog | Fog controls atmospheric distance fog that blends distant objects toward a color. |
| PlayerSpawner | PlayerSpawner controls how the server spawns and respawns characters for connected players. |
| Styles | Styles stores StyleBox overrides keyed by UI part (StylePart) and interaction state (StyleState) on a styled UI entity or World.Theme entity. |
| Sun | Sun controls the direction, tint, and intensity of the world's directional sunlight. |
| SunDisk | SunDisk draws the sun as a visible disk in an Atmosphere sky when attached to a directional light entity. |
| SurfaceView | SurfaceView shows what a camera sees, a portal or a mirror on one face of a part. |
| UIViewport | UIViewport draws the world as a camera sees it inside a UI element's box. |
| User | User is the account identity of a player entity: its user id, its display name, and its round trip time to the server. |
| Worn | Worn marks an accessory root currently worn by a character. |
Entity members¶
The properties and methods of each component an entity can have.
| Name | Summary |
|---|---|
| AeroSurface | Area, CenterOfPressure, InducedDragFactor, LiftSlope, and 2 more |
| Animator | ActiveAnimation, AnimLayers, AnimationWeight, AutoLocomotion, and 5 more |
| Atmosphere | BackgroundColor, BackgroundEnergyMultiplier, Panorama, PanoramaEnergyMultiplier, and 9 more |
| Billboard | BillboardColor, BillboardMaxDistance, BillboardOffset, BillboardOnTop, and 4 more |
| Border | BorderColor, BorderFocusOnly, BorderSizePixel, BorderTransparency |
| Box | AnchorPoint, AspectRatio, ClipsDescendants, Disabled, and 15 more |
| Button | ArrowDirection, Clicked, Cursor, DragEnded, and 9 more |
| Character | Character, CharacterPhysics, CharacterSurfaceAlign, GetStateEnabled, and 14 more |
| CharacterRig | CharacterRig |
| Climbable | Climbable |
| CollisionGroup | CollisionGroup |
| Color | Color, Transparency |
| ConsolePrompt | ConsolePrompt, ConsoleRowLine, ConsoleRowPrefix |
| Decal | Layer, Side, Texture |
| DirectionalLight | DirectionalColor, DirectionalEnergy, DirectionalShadowFill, DirectionalShadowMode, and 1 more |
| DisplayName | DisplayName |
| HingeJoint | ConnectedBody, HingeAnchor, HingeAxis, LimitsMax, and 5 more |
| Image | DisabledImage, HoverImage, Image, ImageColor, and 10 more |
| InputAction | Drives, GetState, StateChanged |
| InputBinding | Direction, Down, Input, KeyCode, and 5 more |
| InputContext | Enabled, Priority, SelectionScope, Sink |
| Lifetime | Remaining |
| Light | InnerAngle, Intensity, LightColor, LightShadowOff, and 2 more |
| LocalSpin | LocalSpin |
| Mesh | Mesh |
| Panel | BackgroundTransparency, CornerRadii, CornerRadius |
| PbrMaterial | Albedo, Emissive, MetallicRoughness, Normal, and 2 more |
| Popup | Options, Popup, PopupOpen |
| Position | LocalPosition, LocalRotation, Position, Size |
| ProgressBar | Progress, ProgressColor, ProgressTrackColor, ProgressTrackTransparency, and 5 more |
| RopeJoint | ConnectedAnchor, ConnectedRigidbody, Distance, LowerTranslation, and 4 more |
| Rotation | PivotPoint, Rotation, Scale |
| ScrollFrame | CanvasPosition, CanvasSize, ScrollBarThickness, ScrollFollowing |
| Shape | Type, RenderDisabled, ShadowOff |
| Sound | Bus, ConeInnerAngle, ConeOuterAngle, ConeOuterGain, and 14 more |
| SwingTwistJoint | Anchor, FrictionTorque, NormalCone, PlaneAxis, and 4 more |
| Timer | TimeLeft, Timeout, TimerAutostart, TimerOneShot, and 2 more |
| UICheckbox | BoxColor, BoxTransparency, CheckColor, CheckTransparency, and 1 more |
| UIColorButton | SwatchColor, SwatchPreview, SwatchTransparency |
| UIColorPicker | BarWidth, Brightness, Hue, Saturation |
| UIDialog | Canceled, CancelText, Confirmed, ConfirmText, and 1 more |
| UIDock | DockPrefab |
| UIFoldable | HeaderColor, HeaderHeight, HeaderTransparency |
| UIGraph | GraphOffset, GraphZoom, GraphZoomMax, GraphZoomMin, and 7 more |
| UIGridLayout | CellPadding, CellSize, ColumnWidths, Columns, and 8 more |
| UIHitSlop | HitSlopBottom, HitSlopLeft, HitSlopRight, HitSlopTop |
| UIIcon | IconAlign, IconGap, IconSize |
| UIItemList | SelectedIndex, SelectionColor, SelectionTransparency |
| UIJoystick | StickCenter, StickDeadzone, StickDirection, StickMode, and 2 more |
| UIListClipper | ItemCount, ItemHeight, ItemShown |
| UIListLayout | Align, Axis, Justify, MarginBottom, and 4 more |
| UIListStripe | StripeColor, StripeTransparency |
| UIMenu | HighlightColor, HighlightTransparency, MenuCheck, Open, and 4 more |
| UIMultiSelect | MultiSelectColor, MultiSelectTransparency, MultiSelected |
| UINumberField | Number, NumberMax, NumberMin, NumberStep |
| UIPlot | PlotColor, PlotTransparency, PlotType, SampleCount, and 2 more |
| UIRadialFill | FillAmount, FillMode |
| UIRadioButton | CircleColor, CircleTransparency, DotColor, DotTransparency, and 2 more |
| UIScreenInsets | InsetEdge, ScreenInsets |
| UIScrollBar | ScrollBarMax, ScrollBarMin, ScrollBarPage, ScrollBarValue |
| UISeparator | LabelText, LineColor, LineThickness, LineTransparency |
| UISlider | FillColor, FillImage, FillTransparency, HighValue, and 19 more |
| UISurface | SurfaceCanvasSizeX, SurfaceCanvasSizeY, SurfaceFace, SurfaceLightInfluence, and 3 more |
| UITableHeader | HeaderCell, SortColumn, SortDescending |
| UITabs | SelectedTabColor, SelectedTabTransparency, TabColor, TabTransparency |
| UITextInput | CursorColor, CursorPosition, CursorTransparency, Focused, and 8 more |
| UITextStyle | Bold, FontFamily, FontWeight, Italic, and 15 more |
| UIToggle | KnobColor, KnobImage, KnobInset, KnobTransparency, and 12 more |
| UITreeView | BranchColor, BranchTransparency, Folded, Indent |
| UIVectorField | VectorCount, VectorMax, VectorMin, VectorSpeed, and 1 more |
| UIWindow | GripSize, TitleHeight, Floating |
| UvTransform | Angle, Offset, Tiling |
| Velocity | Velocity |
| Weld | BreakForce, BreakTorque, Other |
| WheelJoint | Axle, Chassis, CorneringStiffness, DriveTorque, and 21 more |
Objects¶
Ready-made entities that Studio inserts, and the components each one starts with.
| Name | Summary |
|---|---|
| BillboardGui | A 2D UI canvas that floats over its parent part and always faces the camera. |
| Character | A rigged, physically simulated avatar with humanoid locomotion, health, and animations. |
| Clouds | The volumetric cloud layer, drawn over every sky and lit by the Sun. |
| Decal | An image texture projected onto a face of a 3D part. |
| DirectionalLight | A sun or moon light source that illuminates the world with parallel rays. |
| Environment | Global atmosphere, skybox, ambient lighting, and post-processing exposure. |
| Frame | A rectangular 2D panel that displays a background fill, border stroke, and rounded corners. |
| ImageLabel | A 2D element that displays a static or animated image texture. |
| InputAction | A game action, such as Jump or Open Bag, that its bindings press and release. |
| InputBinding | One key, gamepad button or UI button that presses its parent action. |
| InputContext | A group of input actions that turns on and off together, with a priority over other groups. |
| Part | A physical 3D primitive block, sphere, cylinder, cone, or wedge. |
| ParticleEmitter | Sprays 20 spark particles a second out of a small sphere; a child entity of a part or a ParticleEffect. |
| PointLight | A light source that emits illumination in all directions from a point. |
| ScreenGui | Root 2D canvas container that renders UI elements directly onto the player's screen. |
| ScrollingFrame | A container element with scrollable content clipped to its canvas boundary. |
| Slider | A draggable track control that lets the player select a stepped value or continuous range. |
| Sound | An audio emitter that plays sound clips either in 2D space or placed in 3D world space. |
| SpawnLocation | A platform where player characters spawn into the world. |
| SpotLight | A light source that projects illumination in a focused cone along its direction. |
| SurfaceGui | A 2D UI canvas mapped onto a face of its parent part. |
| TextBox | An interactive editable single-line or multi-line text input field. |
| TextButton | A clickable 2D button with label text, hover and press state changes, and click events. |
| TextLabel | A 2D element that renders non-interactive formatted text. |
| Toggle | A two-state on/off switch control with an animated pill track and thumb knob. |
Types¶
Values that calls take and return.
| Name | Summary |
|---|---|
| AnimLayerRow | |
| AnimLayers | |
| AudioPlayAtOptions | AudioPlayAtOptions configures playback speed, distance attenuation, volume, mixer bus routing, and the receiving players for a one-shot Audio.PlayAt cue. |
| AvatarAccessory | |
| AvatarManifest | |
| ClientMessageOptions | |
| ClientMsg | ClientMsg is an opaque handle returned by Net.ToClients that identifies a typed server-to-client message. |
| CloudStore | CloudStore is a collection of records shared by every server of the game, opened with CloudStore.Open. |
| ColorCurve | ColorCurve is an immutable curve of Color values from time 0 to 1, created with ColorCurve.new or ColorCurve.linear. |
| Column | Column reads and writes one value per entity that a Query matches. |
| Component | Component reads and writes the fields of one component on an entity. |
| ComponentHandle | |
| ComponentOptions | ComponentOptions configures replication scope, persistence, singleton storage, custom signals, relationship behavior, and editor hints on World.DefineComponent. |
| ComponentSignal | ComponentSignal is a world-wide signal on a component handle, such as Component.User.Added, Component.User.Removed, or Component.Button.Clicked. |
| Connection | Connection is a subscription returned by Signal:Connect, Signal:Once, Entity:On, World.On, or Net.On. |
| ContentAsset | ContentAsset is one downloaded asset in memory, returned by Content.Fetch. |
| DeclaredSignal | DeclaredSignal is a custom ComponentSignal declared through ComponentOptions.Signals on World.DefineComponent. |
| ExplodeOptions | ExplodeOptions filters which entities Physics.Explode pushes and whether the blast impulse can break joints. |
| FieldHint | |
| FrameStats | FrameStats reports how long each part of the engine took in the last frame, in seconds, and how much memory Luau uses, in bytes. |
| Insets | Insets is an immutable four-edge offset in UI points, created with Insets.new, Insets.all, or Insets.Zero. |
| KeybindChange | |
| MaterialAudio | MaterialAudio configures footstep or impact sounds. |
| MaterialEmission | MaterialEmission configures glow texture, color, and brightness. |
| MaterialEntry | MaterialEntry is one entry from Materials.GetMaterials. |
| MaterialPhysics | MaterialPhysics configures density, friction, and bounce. |
| MaterialSpec | MaterialSpec describes a material for Materials.DefineMaterial and Materials.GetMaterial. |
| MaterialStuds | MaterialStuds configures top and bottom stud textures for "Stud" materials. |
| MaterialSurface | MaterialSurface configures surface textures and shading multipliers. |
| MaterialWater | MaterialWater configures optics, foam, flow, and waves for "Water" materials. |
| NumberCurve | NumberCurve is an immutable curve of numbers from time 0 to 1, created with NumberCurve.new or NumberCurve.linear. |
| NumberRange | NumberRange is an immutable [Min, Max] interval from NumberRange.new. |
| OperatorSpec | OperatorSpec is passed to plugin:Operator to configure an operator. |
| OverlayItem | OverlayItem describes one 3D viewport shape in a tool's Modal overlay list (up to 1,024 items), in Part's unscaled local frame. |
| Pair | Pair is an entity relationship ("ChildOf", "Tag", or "WornBy") built with World.Pair and has no fields or methods. |
| ParamSpec | ParamSpec describes one parameter in OperatorSpec.Params. |
| PlayerSpawnOptions | PlayerSpawnOptions configures where and from which prefab World.PlayerSpawner:Spawn creates a player's character. |
| Plugin | Plugin is the type of the plugin global, which registers a Studio plugin's operators, viewport tools, and Plugins tab buttons. |
| PluginContext | PluginContext passes Studio's selection, snap steps, camera state, the seats of the edit session, and (inside Execute) Edit to Poll, Execute, and Modal. |
| PluginEdit | PluginEdit modifies the edit place inside an operator's Execute via ctx.Edit. |
| PluginEvent | PluginEvent describes one viewport input event passed to ToolSpec.Modal. |
| PluginHit | PluginHit describes where a PluginEvent cursor ray hits an unlocked part within 1000 units. |
| ProductReceipt | ProductReceipt describes a consumable purchase passed to Marketplace.HandlePurchase. |
| Query | Query matches entities that have every given component and Pair. |
| QueryOptions | QueryOptions filters colliders tested by Physics.Raycast, Physics.OverlapSphere, Physics.OverlapBox, and Physics.Spherecast. |
| RaycastHit | RaycastHit describes a hit from Physics.Raycast. |
| Rect | Rect is an immutable 2D rectangle (minX, minY, maxX, maxY) in pixels, created with Rect.new. |
| RibbonSpec | RibbonSpec configures a button group passed to plugin:Ribbon. |
| ScopeCost | ScopeCost reports custom scope timings recorded through Profiler.Begin, Profiler.End, and Profiler.Scope, returned by Profiler.Scopes. |
| ScriptCost | ScriptCost reports per-script callback timings from Profiler.Scripts. |
| ServerMessageOptions | |
| ServerMsg | ServerMsg is an opaque handle returned by Net.ToServer that identifies a typed client-to-server message. |
| ShapecastHit | ShapecastHit describes one contact along a sweep from Physics.Spherecast, Physics.Boxcast, or Physics.Capsulecast. |
| Signal | Signal runs functions when a service or object event fires, such as Chat.MessageSent, Input.Pressed, or tween.Finished. |
| SortedCloudStore | SortedCloudStore is a shared leaderboard of whole-number scores opened with CloudStore.OpenSorted; see CloudStore for request budgets. |
| Store | Store reads and writes per-key values in a local server save file opened with Store.Open; see Store for file paths. |
| StyleBox | StyleBox is an immutable UI surface style created with StyleBox.new. |
| StyleBoxInit | |
| SubscriptionStatus | SubscriptionStatus describes a player's subscription from Marketplace.GetSubscriptionStatus. |
| SystemCost | SystemCost reports per-system callback timings from Profiler.Systems. |
| ToolSpec | ToolSpec configures a viewport tool passed to plugin:Tool. |
| Touch | |
| Tween | Tween controls a running property animation from Tween.Play or Tween.Create; see Tween for tweenable types and options. |
| vector |
Globals¶
Names every script can use without requiring anything.
| Name | Summary |
|---|---|
| _G | _G is a table that all server scripts, or all client scripts of one player, read and write. |
| Color | Color is an immutable linear RGBA color. |
| ColorCurve | ColorCurve creates an immutable curve of Color values over normalized time from 0 to 1, such as a particle color ramp over a particle's lifetime. |
| Field | Field builds typed field and signal parameter descriptors for World.DefineComponent and Net message definitions. |
| Insets | Insets creates an immutable four-edge offset (Left, Top, Right, Bottom) used for UI padding, hit slop, safe areas, and nine-slice borders. |
| NumberCurve | NumberCurve creates an immutable curve of numbers over normalized time from 0 to 1, such as particle size or opacity over a particle's lifetime. |
| NumberRange | NumberRange creates a range of numbers, such as a particle lifetime, where each particle picks its own value between the ends. |
| Rect | Rect creates a 2D rectangle from the pixel positions of two corners. |
| Rotation | Rotation is an immutable unit-quaternion 3D orientation. |
| self | self is the entity that runs the script, usually the part the script is attached to. |
| StyleBox | StyleBox creates an immutable visual style for UI panels, frames, and controls combining background color, border, corner radius, padding, and optional nine-slice image. |
| UIVector | UIVector is an immutable 2D UI coordinate combining fractional parent Scale (Vector2) and fixed Points (Vector2). |
| Vector2 | Vector2 creates immutable 2D vectors for interface coordinates, anchors, and texture coordinates. |
| Vector3 | Vector3 creates 3D vectors for positions, directions and sizes, in units. |
Libraries¶
Tables of functions for building values and running code.
| Name | Summary |
|---|---|
| DynamicImage | DynamicImage is an image whose pixels a client script draws while the game runs, such as a paint canvas, a minimap or a crosshair. |
| DynamicMesh | DynamicMesh builds a 3D shape from vertices and triangles while the game runs, such as generated terrain. |
| Geometry | Geometry provides polygon triangulation helpers. |
| task | task runs functions later or in their own threads, and pauses the running thread. |
Functions¶
Functions every script can call.
| Name | Summary |
|---|---|
| print writes its arguments, separated by tabs, to Output and the in-game console (F9). | |
| warn | warn writes its arguments to the output as a warning, like print. |
Callbacks¶
Functions you define and the engine calls.
| Name | Summary |
|---|---|
| PhysicsUpdate | PhysicsUpdate is a global function that the engine calls before every physics step with the step length in seconds, for code that pushes parts with forces. |
| Update | Update is a global function that the engine calls every frame with the seconds since the last frame. |