world.raycast:reskate.world.raycast,pickandprobe.world.environment:reskate.world.set_time,set_controlandset_park.world.objects:reskate.objects.catalog,list,place,moveandremove.objects.physics:reskate.objects.physics,velocity,motion,poseandcontact.marker.read:reskate.marker.events.world.entities:reskate.entities.*.travel:reskate.travel.*.world.ai:reskate.ai.*.
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.
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.
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.
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.
When
vehicle is nil: "nothing hit", "not a vehicle", "layout differs", "already taken" (another handle holds it), "too many vehicles" or "unavailable"."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()
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()
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.
A quaternion:
x, y, z, w, or entries 1 to 4. Four finite numbers, not all 0; it is normalized for you.vehicle:release()
Lets the vehicle go back to the traffic.
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 returnfalse, "more than 4 changes in a second".
reskate.world.set_time(time)
Forces a time of day on the map, or gives it back to the level.
"morning", "noon", "afternoon", "evening", "night", "weatherday", "weathernight", or "default" for the level’s own. At most 20 characters.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.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.
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.
"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.
"construction" (Construction site / Hedgemont), "historic" (Piers 1 / Historic) or "financial" (Piers 2 / Financial). At most 30 characters.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."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"."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.
Needs the
world.objects permission.reskate.objects.list()
The park editor objects on the map being played.
Needs the
world.objects permission.reskate.objects.place(item, position, heading, scale)
Places a new object. Find its id afterwards with list().
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".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.
The object’s id, from
list(): a decimal string of a whole number from 1, digits and nothing else. A number is not taken.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.
The object’s id, from
list(): a decimal string of a whole number from 1, digits and nothing else. A number is not taken.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.
- Claims. A plugin claims an object by its id, from
reskate.objects.list, withphysics. 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.
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: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".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.
Needs the
objects.physics permission and a client-only plugin.reskate.objects.velocity(id, velocity)
Sets a claimed, dynamic object moving.
"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.
"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.
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.
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.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.
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:
statusgivesnilfor each id. Place yours again in the next level (thelevel_loadedevent 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.
Your number for the object: a whole number from 1 to 2147483647. Each plugin has its own ids.
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.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.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.True when ReSkate keeps the object. It is made over the next frames: use
status to know when it is there.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
statusgives"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.
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.
"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 withhidden.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.
Only names starting with this, ASCII case ignored, such as
"World/Props/". At most 200 characters. Nothing for all of them.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.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.
The box’s lowest corner.
nil (and no max) when the blueprint has no mesh, or its mesh is not loaded.Needs the
world.entities permission.reskate.entities.ready()
Whether all your objects are in the world.
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.
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.
Needs the
travel permission.reskate.travel.go(id)
Fast travels to a destination.
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.
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.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.
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.
Needs the
world.ai permission.reskate.ai.count()
How many AI skaters are in the world now.
Needs the
world.ai permission.