Skip to main content
These tables read and change the world the local skater is in. Each function needs a permission, named in its section:
  • world.raycast: reskate.world.raycast, pick and probe.
  • world.environment: reskate.world.set_time, set_control and set_park.
  • world.objects: reskate.objects.catalog, list, place, move and remove.
  • objects.physics: reskate.objects.physics, velocity, motion, pose and contact.
  • marker.read: reskate.marker.events.
  • world.entities: reskate.entities.*.
  • travel: reskate.travel.*.
  • world.ai: reskate.ai.*.
Rigid bodies of your plugin’s own are on physics bodies (reskate.world.physics), and particle effects and decals on effects. Calling a function without its permission raises an error. See permissions. Positions are Luau vectors in metres, y up; a position you pass must be finite and within 100 km of the map’s centre, or the call raises an error. Headings are radians about world up, as the skater’s.

Raycasts

reskate.world.raycast(from, to)

Where the line from from to to first meets the world’s collision. Use it to find the ground under a point, or whether something is in the way.
vector
required
The ray’s start.
vector
required
The ray’s end, at most 1000 m from from.
vector or nil
Where the ray first meets the world, or nil when it is clear.
Needs the world.raycast permission. A ray longer than 1000 m, or more than 64 raycasts in one tick, raises an error. Collision is loaded only near the skater: far from it, a ray meets nothing and returns nil.

reskate.world.pick(from, to)

Like raycast, and also the world object the ray meets: what it is and where it stands. A prop hunt uses it to let a hider become the prop they look at.
vector
required
The ray’s start.
vector
required
The ray’s end, at most 1000 m from from.
table or nil
nil when the ray meets nothing. Otherwise:
Needs the world.raycast permission, and counts towards its 64 raycasts a tick. A ray longer than 1000 m raises an error. As with raycast, collision is loaded only near the skater.

reskate.world.probe(from, to)

Like raycast, but it tells a clear ray from one that could not be cast. raycast and pick return nil for both; probe says which, so a plugin that needs real collision can wait instead of treating the way as clear.
vector
required
The ray’s start.
vector
required
The ray’s end, at most 1000 m from from.
table
It gives no surface normal, no velocity and no object. A ray shorter than about 10 micrometres is "unavailable" without being cast. A hit that does not lie on the ray is "unavailable" too, never "clear". A clear ray says only that this ray met nothing; collision far from the skater may not be loaded.
Needs the world.raycast permission. Takes exactly two arguments; any other count raises an error. Counts towards the 64 raycasts a tick. It also shares 64 casts in the game a tick with ray batches; once those are spent it returns "unavailable".

Traffic vehicles

reskate.world.vehicles takes a traffic car the plugin points at and holds it where the plugin puts it: its physics, its collision and the drawn car all follow. A plugin holds at most 4 vehicles. A vehicle is a handle with its own functions (vehicle:state() and the rest); it names nothing in the game, and only the plugin instance that took it can use it.

reskate.world.vehicles.take(from, to)

Casts a ray as world.pick does, and takes the traffic vehicle it meets first.
vector
required
The ray’s start.
vector
required
The ray’s end, at most 1000 m from from.
vehicle or nil
The handle, or nil and why not.
string
When vehicle is nil: "nothing hit", "not a vehicle", "layout differs", "already taken" (another handle holds it), "too many vehicles" or "unavailable".
A new handle is "finding" for the first updates while ReSkate finds the car’s body and its traffic driver, then "held".
Needs the world.vehicles permission. It counts towards the 64 raycasts a tick that world.raycast gives. A ray longer than 1000 m, or more than 64 rays in one tick, raises an error.

vehicle:state()

string
"finding", "held", "lost" or "released".
string
For a lost vehicle: why, such as "no agent" (no traffic driver was found within 2 seconds), "ambiguous agent", "not a vehicle", "layout differs", "already taken" or "vehicle removed" (the game removed the car, or the level changed).

vehicle:pose()

vector or nil
Where the vehicle is, while it is held; nil otherwise.
table
Its rotation as a quaternion: x, y, z and w, also as entries 1 to 4.

vehicle:set_pose(position, rotation)

Puts the held vehicle at a pose. It holds there, updated before each of the game’s own updates, until you set another or release it.
vector
required
Where to put it, each coordinate within 100,000 m of the world’s origin.
table
required
A quaternion: x, y, z, w, or entries 1 to 4. Four finite numbers, not all 0; it is normalized for you.
boolean
True when the pose is set.
string
When ok is false: "vehicle is not held", "vehicle removed" or "invalid pose".

vehicle:release()

Lets the vehicle go back to the traffic.
boolean
True when the handle was yours.
The traffic keeps counting a held car’s progress along its lane. When it is let go, it can jump back to that progress or race after it, and the game may remove it within seconds. Your plugin stopping or being turned off releases every vehicle it holds.

Time of day and world controls

These change the world’s look and life as ReSkate’s world menu does. All three share a budget of 4 changes a second; past it they return false, "more than 4 changes in a second".
set_control and set_park save the player’s own choices, as the world menu does. They stay after your plugin stops: put back what you changed when you are done.

reskate.world.set_time(time)

Forces a time of day on the map, or gives it back to the level.
string
required
"morning", "noon", "afternoon", "evening", "night", "weatherday", "weathernight", or "default" for the level’s own. At most 20 characters.
boolean
True when the time of day was set.
string
Why not: "the host chooses the time of day", "no map is loaded", "this map has no time of day", the list of times for one that is not, or the game’s reason.
Needs the world.environment permission. In a session, the host chooses the time of day.
On a dedicated server, a server copy sets the time of day for everyone, on every map, as the server’s tod command does, and the server keeps it. That needs the server’s world layers: a world-layers.json beside it and layer-sync on. Otherwise it returns false and "the server has no world layers (world-layers.json beside it)" or "the server lets players keep their own world layers (layer-sync is off)". set_control and set_park are not available there.

reskate.world.set_control(control, value)

Sets one of the world controls. -1 gives a control back to the game’s own.
string
required
At most 30 characters, one of:
  • "fog": 0 or 1.
  • "fog_distance": 0.1 to 5.
  • "sky_brightness": 0 to 3.
  • "clouds": 0 to 2.
  • "wind_strength": 0 to 30.
  • "wind_direction": 0 to 360 degrees.
  • "traffic": 0 to 3, a whole number.
  • "pedestrians": 0 to 3, a whole number.
  • "reset_environment": any value; every control but traffic and pedestrians goes back to the game’s own.
number
required
Within the control’s range, or -1 for the game’s own. Not finite raises an error.
boolean
True when the control was saved; it is applied a moment later.
string
"the game refused it (no map loaded, or not that control)" for a name or value it does not take, or "more than 4 changes in a second".
Needs the world.environment permission.

reskate.world.set_park(lot, layout)

Chooses the community park layout on one of the map’s park lots. It loads when the game’s park controller is ready.
string
required
"construction" (Construction site / Hedgemont), "historic" (Piers 1 / Historic) or "financial" (Piers 2 / Financial). At most 30 characters.
string
required
A layout id, at most 40 characters: a family (flumppark, megapark, skatepark or streetpark), _ and a two-digit variant, such as "skatepark_03"; or "empty". Each lot has its own variants, below.
boolean
True when the choice was saved.
string
"that is not a lot and one of its layouts" for a lot or layout not in the table below, "the host chooses the parks, or that is not a lot and layout", or "more than 4 changes in a second".
The lot and layout are checked first. Each lot takes "empty" and these layouts:
Needs the world.environment permission. In a session, the lobby’s host chooses the parks.

Objects

reskate.objects places, moves and removes park editor objects on the map being played. Every edit goes through the park editor, as if the player made it there (the editor need not be open): the same catalog, the same limits, and in a session the same object rules the host set. An edit is applied over the next moments. While one is being applied, the next is refused with "the last edit is still being applied": space your edits out, or try again a tick later. place, move and remove share a budget of 4 edits a second.

reskate.objects.catalog()

The objects that can be placed: the installed Build Kit catalog.
table
A list, empty when there is no catalog. Each entry:
Needs the world.objects permission.

reskate.objects.list()

The park editor objects on the map being played.
table
A list. Each entry:
Needs the world.objects permission.

reskate.objects.place(item, position, heading, scale)

Places a new object. Find its id afterwards with list().
string
required
A catalog key, at most 200 characters.
vector
required
Where it goes.
number
default:"0"
Radians about world up.
number
default:"1"
0.1 to 10.
boolean
True when the edit was started.
string
Why not, such as "objects cannot be placed here now", "the last edit is still being applied", "The host has disabled object placement for you.", "Park object limit reached.", "Object is not available in the installed Build Kit catalog." or "more than 4 edits in a second".
A heading that is not finite or a scale out of range raises an error.
Needs the world.objects permission. A map holds at most 1024 objects; in a session the host may set a lower limit for each player.

reskate.objects.move(id, position, heading, scale)

Moves an object, and turns or resizes it if you ask. What you leave out keeps the object’s own: with no heading it keeps its rotation, and with no scale its size.
string
required
The object’s id, from list(): a decimal string of a whole number from 1, digits and nothing else. A number is not taken.
vector
required
Where it goes.
number
default:"the object's own"
Radians about world up.
number
default:"the object's own"
0.1 to 10.
boolean
True when the edit was started.
string
Why not, such as "The selected object no longer exists." or any of place’s reasons.
Needs the world.objects permission. An id that is not a whole decimal string (a number, "", "0", "12abc" or " 12"), a heading that is not finite, or a scale out of range raises an error.

reskate.objects.remove(id)

Removes an object.
string
required
The object’s id, from list(): a decimal string of a whole number from 1, digits and nothing else. A number is not taken.
boolean
True when the edit was started.
string
Why not, such as "The selected object no longer exists." or any of place’s reasons.
Needs the world.objects permission. An id that is not a whole decimal string raises an error.

Object physics

objects.physics lets a plugin take over the physics of park objects already placed in the local park, and make them fall, roll and be knocked over: a QuickDrop that tumbles, a rail that slides when you hit it. The plugin decides what happens; ReSkate gives it the object’s motion and the means to push it.
Object physics is for a plugin whose manifest says "side": "client"; any other plugin’s call raises an error. It works offline only: in a multiplayer session, while objects cannot be placed, while the park is being cleared, and in the park editor or a menu, a claim is refused. Other players never see the motion.
  • Claims. A plugin claims an object by its id, from reskate.objects.list, with physics. Only objects that stand fixed can be claimed, checked on the object as your game draws it. The game also keeps the park’s own version of each object, which follows the claim. A park version that is there but has no physics body ReSkate can reach follows the object by its position instead. When the game moves that version itself, or it cannot be found within a second, the claim is let go for you, with a line in the log (Object physics: object <id> let go: ...), so the object never moves where its collision does not follow. One plugin holds an object at a time, and no other plugin can move, sample or release it. A plugin claims at most 32 objects, and all plugins together 128.
  • Never saved. A claimed object’s moved pose is never saved with the park. When the claim is let go, the object goes back to where it was placed (or where a park editor edit put it since). To keep an object where it fell, move it there with reskate.objects.move, which saves.
  • Let go for you. Clearing the park, a level change and your plugin stopping let go of every claim. The menu and the park editor hold claimed objects still while they are open.

reskate.objects.physics(id, options)

Claims an object, changes its claim, or lets it go.
string
required
The object’s id, a decimal string from list().
table or nil
nil (or left out) lets go of your claim, and the object goes back to its placed pose. A table claims it, or changes your claim:
boolean
True when the claim is made, changed or let go.
string
Why not, such as "object physics is offline-only and unavailable while editing or in a menu", "not a live local placement", "another plugin controls this object's physics", "only fixed local placement bodies may be claimed", "object physics limit reached", "object changed; release its old physics claim first", "object physics rate limit reached", "this plugin does not control this object's physics" or "unavailable here".
The same options again change nothing. Different options change a claim at most every 16 ms.
Needs the objects.physics permission and a client-only plugin. An id that is not a decimal string of a whole number from 1, or a mass that is not a number from 0.1 to 20000, raises an error.

reskate.objects.motion(id)

Where a claimed object is and how it moves now.
string
required
The object’s id.
table or nil
nil when you do not hold the object, or its body cannot be read.
Needs the objects.physics permission and a client-only plugin.

reskate.objects.velocity(id, velocity)

Sets a claimed, dynamic object moving.
string
required
The object’s id.
vector
required
Metres per second, in the world: a speed of at most 45 m/s.
boolean
True when it was set.
string
"object physics is unavailable" (offline only, not while it is being edited, and only for a dynamic claim), "object velocity rate limit reached", or "this plugin does not control this object's physics".
Needs the objects.physics permission and a client-only plugin. Once every 16 ms for each object. A velocity that is not finite or faster than 45 m/s raises an error.

reskate.objects.pose(id, position, rotation)

Puts a claimed object somewhere, and stops it moving.
string
required
The object’s id.
vector
required
Where it goes, within 100 km.
table
required
A unit quaternion as a list {x, y, z, w} (its squared length between 0.95 and 1.05).
boolean
True when it was placed.
string
"object physics is unavailable", "object pose rate limit reached", "object pose could not be applied" (try again), or "this plugin does not control this object's physics".
Needs the objects.physics permission and a client-only plugin. Once every 250 ms for each object. A rotation that is not four numbers of a unit quaternion raises an error.

reskate.objects.contact(from, to)

Which of your claimed objects a short ray meets first.
vector
required
The ray’s start.
vector
required
The ray’s end, at most 10 m from from.
table or nil
nil when the ray meets nothing, or meets something before any object you hold: it never sees through the world.
Needs the objects.physics permission and a client-only plugin. Counts towards the 64 raycasts a tick, past which it raises an error. A ray longer than 10 m raises an error.

Marker events

reskate.marker.events()

The marker saves and returns the local skater made since your last call: for a plugin that keeps something of its own with each marker, such as where its objects were.
table or nil
A list, oldest first, of "saved" (a marker was set) and "returned" (the skater went back to the marker). Only the game’s own return to the saved marker counts as "returned", not other teleports. nil and "unavailable here" when it cannot be read.
boolean
True when events were missed since your last call: act on none of the old ones.
The first call starts listening and returns an empty list: events from before it are not replayed. ReSkate keeps the last 32 events. A level change drops the ones not yet read.
Needs the marker.read permission and a client-only plugin.

Your own world objects

reskate.entities puts world objects of your plugin’s own into the map: an entity of any world object blueprint the game has loaded, such as a prop, a gate’s arch or a traffic cone, at a full transform. They are not park editor objects: they are not saved with the park, and the editor does not list them. You give each object a number of your own, its id, and say what it is and where. ReSkate makes the object, moves it and takes it away for you over the next frames. Calling set again with the same id moves the object in place, or makes it again when the blueprint is a different one. A solid object you move yourself moves at most every 16 ms, and one with collision of its own (a blueprint with a physics shape) is made again where you move it, at most every 100 ms, so that its collision comes with it; an object that is not solid, or is on a joint, follows its new transform every frame.
Only your game shows these objects. Another player sees them only when their copy of your plugin places them too. A dedicated server has none: set returns false, "unavailable here" there.

When objects exist

  • Objects are made only while a level is loaded, from the moment the local skater’s world is ready. Until then they wait.
  • A blueprint is looked for in every loaded part of the game, at most once a second for each name. A blueprint that is not loaded on this map stays "missing", and ReSkate keeps looking.
  • When a blueprint’s data streams out, its objects go with it, and come back when it is found again.
  • A level change takes every object away, and ReSkate forgets them: status gives nil for each id. Place yours again in the next level (the level_loaded event is a good time).
  • When your plugin stops, its objects go.

Transforms

A transform is a table in one of three forms: position is checked as every position on this page: finite and within 100 km, or the call raises an error. The game checks the whole transform too: every number finite, the position within 100 km, and each axis at most 200 long. A transform that breaks those rules is refused.
yaw here is in degrees. Headings elsewhere, such as the skater’s, are radians: convert with math.deg.

reskate.entities.set(id, blueprint, transform, hidden, attach, options)

Makes, moves or changes one of your objects.
integer
required
Your number for the object: a whole number from 1 to 2147483647. Each plugin has its own ids.
string
required
The world object blueprint’s name, as the game’s data names it, such as "World/Props/Common/Construction/CMN_PRP_TrafficCone_01/CMN_PRP_TrafficCone_01". At most 200 characters.
table
required
Where the object goes, in one of the forms above.
boolean
default:"false"
true keeps the object under its id but out of the world: it is taken away, and made again when you set it without hidden.
table
Keeps the object on a joint of a skater, moved with it every frame: a camera in a hand, a hat on a head. The transform is then in the joint’s frame: its position is along the joint’s own axes, from the joint.
table
boolean
True when ReSkate keeps the object. It is made over the next frames: use status to know when it is there.
string
Why not: "an object's blueprint is a name of 1 to 200 characters", "an object's transform must be finite, within 100 km, each axis at most 200 long", "at most 512 objects", "the world holds as many objects as ReSkate keeps", or "objects that are not solid or stand on the ground are unavailable for this game build".
Needs the world.entities permission. An id that is not a whole number from 1, a blueprint longer than 200 characters, a transform that is not a table, a matrix that is not 16 numbers, a scale that is neither a number nor a vector, an axis that is not a vector, or an angle that is not finite raises an error. So does an attach that is not a table, a joint that is not a whole number from 0 to 394 or one of the five names, a player that is not a player’s id, a ground outside 0 to 50, or an options that is not a table. A plugin keeps at most 512 objects, and ReSkate keeps at most 1024 for all plugins together. Moving or changing an object you already have does not count again.

Objects on a joint

  • An attached object is not made until its joint is known: for your own skater, from the frame after you set it; for another player, once your game draws their skater. Until then status gives "waiting" or "loading".
  • It moves every frame, without the 16 ms an object you move yourself waits between moves.
  • When its joint stops being known (the player left, or your skater is gone), it stays where it was, and after a second it is taken away until the joint comes back.
  • ReSkate reads at most 32 joints of your own skater and 64 of other players’ at once, for every plugin together. An object on a joint past those waits.

reskate.entities.remove(id)

Takes one of your objects away and forgets its id.
integer
required
The object’s id, 1 to 2147483647.
Returns nothing. Removing an id you did not set does nothing.
Needs the world.entities permission.

reskate.entities.clear()

Takes every one of your objects away. Returns nothing.
Needs the world.entities permission.

reskate.entities.status(id)

Where one of your objects is.
integer
required
The object’s id, 1 to 2147483647.
string or nil
  • "waiting": its blueprint has not been looked for yet, or the world is not ready.
  • "loading": its blueprint was found, and the object is being made.
  • "missing": its blueprint was looked for and is not loaded. ReSkate looks again every second.
  • "ready": the object is in the world.
  • "hidden": you set it with hidden.
  • nil: you did not set this id, you removed it, or a level change took it.
Needs the world.entities permission.

reskate.entities.blueprints(start, meshes)

The world object blueprints the game has loaded: what set can make on this map. Pick one at random, or offer a list. The list comes from walking every asset table the game holds, on the game’s thread, so reading it is slow: tens of milliseconds on a slow PC. Ask once a map, after the level has loaded, and keep the list. Do not ask every few seconds.
string
Only names starting with this, ASCII case ignored, such as "World/Props/". At most 200 characters. Nothing for all of them.
boolean
default:"false"
True lists only the blueprints with a loaded mesh: the ones that show when made. Others are logic objects, widgets and the like, which set makes but nobody sees.
table
The names, sorted, at most 4096. Empty before a level is active.
Needs the world.entities permission. The list is read only while a level is active. Each pair of start and meshes is its own list, read once and kept for 30 seconds, or until the level changes; calling again in that time gives the same list. So a list kept that long can miss what the map has streamed in or out since.

reskate.entities.bounds(blueprint)

The box a blueprint’s mesh fills, in the object’s own frame: its size, and where its base is. Most props have their origin at their base, so min.y is 0; one that is not stands on its base when you set it -min.y higher.
string
required
The blueprint’s name, at most 200 characters.
vector or nil
The box’s lowest corner. nil (and no max) when the blueprint has no mesh, or its mesh is not loaded.
vector
Its highest corner.
Needs the world.entities permission.

reskate.entities.ready()

Whether all your objects are in the world.
boolean
True when every object you set without hidden is in the world, with the blueprint you last gave it. True when you have none. Always false on a dedicated server.
Needs the world.entities permission.

Travel

reskate.travel.locations()

The fast travel destinations.
table
A list. Each entry:
Needs the travel permission.

reskate.travel.levels()

The levels the game knows. On a dedicated server, the maps the server knows, as its maps command lists them: asset and name for each, and can_load true.
table
A list. Each entry:
Needs the travel permission.

reskate.travel.go(id)

Fast travels to a destination.
string
required
A destination’s id from locations(), at most 260 characters.
boolean
True when the trip was queued.
string
Why not: "one trip every 5 s", "only the session's host changes where everyone is", "there is no destination <id>" or "it cannot travel now".
Needs the travel permission. One trip every 5 seconds, go and load together; a refused trip counts too. In a session, only the host changes where everyone is.

reskate.travel.load(asset)

Loads a level.
string
required
A level’s asset from levels(), at most 260 characters.
boolean
True when the load was queued.
string
Why not: "one trip every 5 s", "only the session's host changes where everyone is", "that level cannot be loaded now" or the game’s reason.
Needs the travel permission. Shares the one trip every 5 seconds with go.
On a dedicated server, a server copy changes the server’s map, as its map command does: everyone goes, and the server keeps the map for its next start. asset is an asset or a name from levels(). It returns false and "the server is already on that map", "this server does not have that map" or "no single map is called ...". The log says [map] A plugin changed the map to <map>., and the plugin hears level_unloading and level_loaded. go is not available there: a server has no fast travel.

AI skaters

AI skaters ride the world on the player’s game only, so they are refused in a session, where the other players would never see them.

reskate.ai.spawn(count)

Spawns AI skaters.
integer
default:"1"
1 to 8 at a time. Out of range raises an error.
boolean
True when the spawn was asked for.
string
Why not: "AI skaters are left out of sessions: the other players would never see them", "at most 16 AI skaters" or "asked more than 4 times in a second".
Needs the world.ai permission. At most 16 AI skaters in the world. Shares the budget of 4 control calls a second with skater.noclip, boost, freeze, camera.follow, animation.play, board.toss and outfit.set.

reskate.ai.clear()

Removes every AI skater, the player’s own included.
boolean
Always true.
Needs the world.ai permission.

reskate.ai.count()

How many AI skaters are in the world now.
integer
0 or more.
Needs the world.ai permission.