Server code
Luau on the server
Plugins, loops and rooms are written in Luau, the typed Lua of Roblox. The code runs in a sandbox on the server: it reaches the data of its own game and nothing else, no files, no network, no other game.
What the code has
| Name | What it is |
|---|---|
ansekai.data | Player Data of any player of the game |
ansekai.realtime | The Realtime Database |
ansekai.storage | Files of the game |
ansekai.cache | The Cache |
ansekai.rooms | Opens rooms and sends players to them |
ansekai.physics, ansekai.physics2d | Physics worlds |
ansekai.log(...) | A line in the logs of the panel |
ansekai.fail(code) | Stops the run and undoes its writes, the client gets the code as an error |
Plugins, loops and rooms can also be drawn as nodes with Kumi, which writes this Luau for you.
The standard libraries of Luau are there too: string, table, math, os.time, bit32, utf8 and coroutine. The editor of the panel completes every name and shows what it does.
One run is one transaction
Every write of a run of a plugin, or of a step of a loop or a room, goes to the database together. When the code crashes or calls ansekai.fail, none of them stays and listening clients hear nothing.
ansekai.rpc("trade", function(ctx, params)
ansekai.data.increment(ctx.player, "gold", -params.price)
ansekai.data.increment(params.seller, "gold", params.price)
if (ansekai.data.get(ctx.player, "gold") or 0) < 0 then
ansekai.fail("not_enough_gold") -- Both writes are undone
end
end)A room that runs on another server than its game is the one exception: each data call commits on its own there. See Rooms.
Failing on purpose
ansekai.fail("code") is an answer, not a bug. The code is small letters, digits and _, 64 characters at most. The SDK throws it as an AnsekaiError with that code.
try {
await ansekai.plugins.call("buy", { item: "sword" });
} catch (error) {
if (error.code === "not_enough_gold") showShop();
}Limits
| Plugin run | Step of a loop or a room | |
|---|---|---|
| Memory | 8 MB | 16 MB, it stays between steps |
| Code time | 100 ms | Half the time between two ticks, 50 ms at most |
| Whole run with waits | 5 s | 1 s |
| Data calls | 100 | 50 |
A run over a limit ends with an error in the logs, its writes are undone. A loop or a room that fails five times in a row stops.
Logs
ansekai.log and every error show on the page of the plugin, the loop or the room. Logs are a help, not data: they are kept for a while and lines that come too fast are dropped.
Updated November 21, 2026