> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reskate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugins

> Run plugins on a dedicated server: the Plugins folder, which plugins run there, what players need, reloading, storage and logs, the server's plugin commands, and what a server plugin can do.

A dedicated server runs [plugins](https://docs.reskate.dev/plugins/overview.md): game modes, rules, chat tools and the like, written in Luau and sandboxed. On the server a plugin is the session's authority. It can kick, ban and move players, speak in chat, show cards and polls, set what each player may do, read their roles and spawn park mods. This is its **server copy**.

## Installing a plugin

Put each plugin in a `Plugins` folder beside `ReSkateServer.exe`, beside its `Mods` folder:

```text theme={null}
ReSkateServer.exe
ReSkateServer.json
Mods/
Plugins/
  Trick_Race/
    manifest.json
    reskate-plugin.json
    plugin/
      main.lua
      server.lua
```

* A plugin is a folder with its `reskate-plugin.json` at the top.
* Only plugins whose `"side"` is `"server"` or `"both"` run on a server. A plugin for players' games alone (`"side": "client"`, the default) does nothing there.
* Copy the whole mod folder, `manifest.json` included, so the server's messages to players go under the same name as their copies of the plugin.

A plugin for `"both"` sides also has a copy on each player's game, and players need the same mod installed for that copy: the server sends them nothing to install. Tell your players which mods the server uses.

The server refuses a plugin whose folder holds a program or a script Windows runs, as the game does: see [plugins that ship programs](https://docs.reskate.dev/mods/rules.md#plugins-that-ship-programs).

## Reloading

The server checks the `Plugins` folder every 2 seconds. A new plugin loads, a changed one reloads, and a removed one unloads, without a restart.

## Storage and logs

* A server copy keeps its [storage](https://docs.reskate.dev/plugins/api/storage.md) in `data/plugins`, beside the server's config file.
* What plugins log and print goes to the server's log, `ReSkateServer.log`.

## Commands

Type these in the server's window:

| Command | What it does |
| - | - |
| `plugin` or `plugin list` | The server plugins: running, with their memory and time a tick, or stopped and why. |
| `plugin commands` | The console commands the server plugins added. |
| `plugin reload <id>` | Unload a plugin and load it again from its files. `<id>` is its folder's name. |
| `plugin off <id>` | Switch a plugin off until `plugin on`, or until the server restarts. |
| `plugin on <id>` | Start a plugin that was switched off or stopped. |

A plugin's own console command, such as `trickrace reset`, runs from the window only for a line the server does not know itself, so a plugin can never hide one of the server's commands. The server answers `Ran by a plugin.` when one ran.

With no plugins, `plugin list` says where it looks: `No server plugins. A plugin is a folder in <folder> with a reskate-plugin.json ("side" "server" or "both").`

## What a server plugin can do

A plugin asks for what it uses with [permissions](https://docs.reskate.dev/plugins/permissions.md) in its manifest. On a dedicated server:

* **Players.** `reskate.session.players()` lists everyone on the server; the server is not one of them. With the `server` permission, a plugin [kicks, bans and moves](https://docs.reskate.dev/plugins/api/server.md#players) players, speaks in chat as itself (`[Its name] ...`) or to one player, and reads and sets [what each player may do](https://docs.reskate.dev/plugins/api/server.md#player-permissions), as `lock` does.
* **Chat.** With `chat.read`, it hears every player's [chat line](https://docs.reskate.dev/plugins/events.md#chat), the server's own lines, and the `/commands` the server does not know itself, so players can talk to it: `/race join`. While a plugin hears chat, the server does not answer those `Unknown command`; the plugin answers.
* **The map.** With `session.read`, [`reskate.session.world()`](https://docs.reskate.dev/plugins/api/session) names the map the server runs, and the plugin hears `level_loaded` when it changes. With `travel`, it lists the server's maps and [changes the map](https://docs.reskate.dev/plugins/api/world.md#travel) for everyone, as `map` does.
* **Time of day.** With `world.environment`, it [sets the time of day](https://docs.reskate.dev/plugins/api/world.md#time-of-day-and-world-controls) for everyone, as `tod` does, when the server has its world layers and `layer-sync` is on.
* **Roles.** It reads each player's [role](https://docs.reskate.dev/plugins/api/server.md#player-roles), so its own commands can follow the server's [roles](https://docs.reskate.dev/servers/roles.md).
* **Cards and polls.** It shows players [cards and polls](https://docs.reskate.dev/plugins/api/server.md#cards-and-polls) of its own, and hears the answers.
* **Parks.** With `server.parks`, it lists, spawns and removes the server's [park mods](https://docs.reskate.dev/plugins/api/server.md#park-mods).
* **Mods.** With `mods.read`, it [reads the content](https://docs.reskate.dev/plugins/api/mods.md#shared-content) of every mod in the server's `Mods` folder, such as a park mod's parks.

A server has no world of its own: no skater, camera or HUD. Functions for those say they are unavailable there. Some `reskate.server` functions also work differently on a lobby's host: see [lobby host and dedicated server](https://docs.reskate.dev/plugins/api/server.md#lobby-host-and-dedicated-server).

A server copy makes at most 20 `reskate.server` calls a second, and one `say` line a second. See [limits](https://docs.reskate.dev/plugins/limits.md).

## Writing one

[Game modes](https://docs.reskate.dev/plugins/guides/game-modes.md) builds a plugin with a server copy step by step, and shows how to try it on a lobby you host before you put it on a server.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.