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.
  • world.environment: reskate.world.set_time, set_control and set_park.
  • world.objects: reskate.objects.*.
  • travel: reskate.travel.*.
  • world.ai: reskate.ai.*.
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.

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.

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().
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 number, 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().
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.

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.
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.

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.