print, require for its own modules, and the Luau libraries the sandbox keeps.
The reskate table and every table inside it are read-only. Assigning to them, rawset on them or a new metatable raises an error.
The plugin
reskate.id
The plugin’s id: the name of its mod folder (Mods/<folder>). A server copy on a lobby’s host has <folder>@server, so it never shares an id with the client copy beside it; on a dedicated server there is no @server. Its storage, its log lines, its toasts, its console commands and everything it holds in the game go under this id.
reskate.side
Which copy of the plugin this is: "client" for the copy on a player’s game, "server" for the session authority’s copy (on the lobby’s host, or on a dedicated server). The manifest’s "side" decides which copies run; see the manifest.
reskate.api_version
The plugin API this ReSkate gives plugins, a number. It is 1. A plugin whose manifest asks for a newer "api" is not loaded.
reskate.Enums
Named constants for the strings the API takes, read-only and built from ReSkate’s own lists, so a name that is not there is nil rather than a typo that never matches. Each constant is the string itself: plain strings work as well.
reskate.level.current()
The level being played.
On a dedicated server’s server copy, it is the map the server runs, named as players’ games name it ("Levels/Game/BAM_LevelRoot/BAM_LevelRoot" on San Vansterdam).
Logging
reskate.log(message, level)
Writes a line to ReSkate’s log, under [<plugin id>].
reskate.log, print and reskate.console.print share one budget of 50 lines a second. Past it, the rest of that second’s lines are left out, and one warning says so. A line longer than 2000 characters is cut short.print(...)
Writes its arguments to ReSkate’s log at the info level, joined by tabs. It replaces Luau’s own print. It writes to the log, not to the console: use reskate.console.print for the console.
Shares the 50 lines a second of
reskate.log.Events
reskate.on(event, handler)
Adds a handler for an event. Every handler of an event runs, in the order they were added. There is no way to take a handler away: keep a flag in your plugin if it should stop acting.
The event’s name. The full list, what each passes to its handler and the permission each needs is on the events page.
load, unload, tick, level_loaded, level_unloading. Every other event needs the permission the events page names.
Raises an error for an event there is none of, for an event whose permission the manifest does not list, and past 256 handlers for one event. A handler call past 50 ms is logged as a warning, and one past 1000 ms stops the plugin; see limits.
Modules
require(name)
Runs a module of the plugin’s own package once and returns what it returned. Modules are found beside the entry: with "entry": "plugin/main.lua", require("rules") runs plugin/rules.luau, or plugin/rules.lua when there is no .luau.
The module’s path from the entry’s folder. A leading
./ is allowed. With no extension, .luau is tried, then .lua; with .lua or .luau, that file only. Folders are separated by /: require("checks/overlay").What the module returned, or
true when it returned nothing. Later calls return the same value without running the module again.Raises an error when the file is not there, when the path is not a path inside the package (no
.., no \, no drive), and when modules require each other in a circle. A source file is at most 1 MB. Modules share the plugin’s globals.The sandbox
A plugin runs in its own Luau VM. Its globals are its own: it can set new ones, and they are shared by its entry and its modules, but the libraries and thereskate table are read-only, as is the string metatable.
What the sandbox keeps:
What it does not have:
io, package, dofile, loadfile, load, loadstring, collectgarbage, and os.execute, os.remove, os.rename, os.getenv and os.exit. A plugin cannot load code from text or bytecode, and it reaches files only through reskate.package and reskate.storage.