API reference

Entity

Anything in the world: a part, a light, a sound, a group.

PropertyTypeAccessDescription
namestringread, write, replicated, savedWhat it is called. Names need not be unique.
parentEntity?read, write, replicated, savedWhat it hangs from. Destroying the parent destroys it too.
SignalArgumentsDescription
destroyingFires just before it is destroyed.
MethodReturnsDescription
:destroy()nothingRemoves it, and everything under it.
:children()anyThe entities directly under it, as a list.
:find(name: string)Entity?The first child with this name, or nil.
:is_a(class: string)booleanTrue when it is this class or one that extends it.
:watch(property: string)anyA signal that fires with (new, old) whenever the property is set.
:add(component, fields?)the new dataGives it a component, with these fields over the component's defaults.
:get(component)the data, or nilIts data for a component. Change the fields directly.
:has(component)booleanWhether it has the component.
:remove(component)booleanTakes the component off. True when it had it.
:attach(behavior, params?)the running instanceStarts a behavior on it, with these parameters over the defaults.
:tween(properties, seconds, easing?)a TweenMoves number and vector properties to new values over time. Easing: linear, in, out, inout.

Group

A container for organizing other entities. It has no body of its own.

Extends Entity.

PropertyTypeAccessDescription
kindstringread, savedWhat the place calls it: Folder or Model.

Part

A solid shape in the world.

Extends Entity.

PropertyTypeAccessDescription
positionvectorread, write, replicated, savedWhere the center is, in studs.
sizevectorread, write, replicated, savedHow big it is along each axis. (0.05 to 1000000)
rotationvectorread, write, replicated, savedOrientation, read and written as XYZ Euler angles in degrees. Reads may return equivalent angles.
colorvectorread, write, replicated, savedRed, green and blue, each from 0 to 1. (0 to 1)
transparencynumberread, write, replicated, saved0 is solid to the eye, 1 is invisible. (0 to 1)
anchoredbooleanread, write, replicated, savedTrue: it stays where it is. False: physics moves it.
solidbooleanread, write, replicated, savedTrue: things collide with it.
shapestringread, write, replicated, savedThe shape: Block, Ball, Cylinder or Wedge. Unknown names draw and collide as a block.
materialstringread, write, replicated, savedThe surface material. Concrete, Wood and Grass add a tiled texture.
frictionnumberread, write, replicated, savedHow much a loose part grips what it slides on: 0 is ice, 0.6 is normal, 1 is rough. (0 to 10)
elasticitynumberread, write, replicated, savedHow much a loose part bounces: 0 does not, 1 returns all its speed. (0 to 10)
massnumberread, write, replicated, savedA loose part's mass in kilograms. 0 works it out from the size. (0 to 1000000)
ladderbooleanread, write, replicated, savedTrue: a character inside it climbs instead of falling.
SignalArgumentsDescription
touchedother: PartFires when another part starts touching it.
touch_endedother: PartFires when a part that was touching it stops.
stepped_onplayer: PlayerFires when a player's character starts touching it.
clickedplayer: PlayerFires when a player clicks it, from up to 64 studs away.
MethodReturnsDescription
:push(impulse: vector)nothingGives it a shove (a loose part).

Light

A point of light.

Extends Entity.

PropertyTypeAccessDescription
positionvectorread, write, replicated, savedWhere it shines from.
colorvectorread, write, replicated, savedThe color of the light. (0 to 1)
brightnessnumberread, write, replicated, savedHow strong it is. (0 to 100)
rangenumberread, write, replicated, savedHow far it reaches, in studs. (0 to 1000)
rotationvectorread, write, replicated, savedOrientation, read and written as XYZ Euler angles in degrees. A spot light shines along its front (-Z).
anglenumberread, write, replicated, saved0 shines every way. Above 0 it is a spot light along its front (-Z) with this cone half-angle in degrees. (0 to 89)
enabledbooleanread, write, replicatedWhether it is on.

Sound

A sound that plays in the world or for a player.

Extends Entity.

PropertyTypeAccessDescription
assetstringread, write, replicated, savedWhich sound to play: sound/<id>.
volumenumberread, write, replicated, savedHow loud, 1 is normal. (0 to 10)
loopedbooleanread, write, replicated, savedWhether it starts again when it ends.
speednumberread, savedThe saved playback speed, 1 is normal.
rangenumberread, savedThe saved distance in studs past which it is silent; 0 plays it at full volume everywhere.
playingbooleanread, replicated, savedWhether it is playing now. A place saves it, so a sound set to play starts with the game.
MethodReturnsDescription
:play()nothingStarts it from the beginning.
:stop()nothingStops it.

Player

Someone playing the game.

Extends Entity.

PropertyTypeAccessDescription
user_idnumberreadTheir account number. Use it, not the entity, as a key in saved data.
positionvectorread, write, replicatedWhere their character is.
healthnumberread, write, replicatedHit points. Zero means dead. (0 to 100000)
pingnumberreadThe round trip to their game, in milliseconds.
SignalArgumentsDescription
diedFires when health reaches zero.
chattedtext: stringFires when they say something in chat.
MethodReturnsDescription
:teleport(to: vector)nothingMoves their character.
:tell(text: string)nothingShows them a private chat line.
:kick(reason: string)nothingRemoves them from the game.

Spawn

A part that marks where characters start. A place picks its spawn when the session begins.

Extends Part.

Workspace

The world root and its saved simulation and camera settings.

Extends Group.

PropertyTypeAccessDescription
gravitynumberread, savedThe saved downward gravity in studs per second squared.
fallen_parts_destroy_heightnumberread, savedThe saved void height in studs.
air_densitynumberread, savedThe saved air density factor.
global_windvectorread, savedThe saved wind vector in studs per second.
interpolation_throttlingbooleanread, savedWhether the place requests interpolation throttling.
camera_fovnumberread, savedThe saved camera field of view in degrees.
camera_typestringread, savedThe saved camera mode.

Lighting

The place's saved sky and lighting settings.

Extends Entity.

PropertyTypeAccessDescription
clock_timenumberread, savedThe time of day in decimal hours.
brightnessnumberread, savedThe sunlight brightness multiplier.
sun_azimuthnumberread, savedThe sun's compass direction in degrees.
sun_elevationnumberread, savedThe sun's angle above the horizon in degrees.
light_colorvectorread, savedThe sunlight tint.
ambient_colorvectorread, savedThe saved ambient tint.
realistic_skybooleanread, savedWhether the place enables the dynamic sky.
sky_modelstringread, savedThe saved sky model, physical or classic.
cloud_densitynumberread, savedThe saved cloud density from 0 to 1.

Script

A script kept in the place. Scripts do not read each other's code.

Extends Entity.

PropertyTypeAccessDescription
kindstringread, savedScript, LocalScript or ModuleScript.
sourcestringread, savedThe code, with its --! directives.

Object

Any other object the place keeps: a remote, a value, a click detector, or one of its settings.

Extends Entity.

PropertyTypeAccessDescription
kindstringread, savedWhat the place calls it: RemoteEvent, IntValue, Lighting, Atmosphere and so on.
textstringread, savedWhat it holds: a value, or the JSON of a setting.