Skip to content

Install a plugin

Put the .cs file in the plugins folder of the game’s data folder:

Server Folder
Dedicated server data/redfive/rustlegacy/plugins/ inside the server folder (next to rustlegacy_world.json)
Lobby hosted from the main menu data/redfive/rustlegacy/plugins/ inside the s&box install (Steam: steamapps/common/sbox)

Create the folder if it does not exist. The server reads it every 2 seconds: a new or changed file starts within 2 seconds, a deleted file stops. No restart needed.

  • A plugin’s settings are in plugins/config/<Name>.json, written the first time it runs. Edit the file, then save the plugin file again (or run rl_plugins_reload) to apply them.
  • Its saved data (scores, positions…) is in plugins/data/<Name>.json.
  • rl_plugins in the server console lists the plugins and whether they run. Errors in a plugin show in the server console with the file, line and column; the game keeps running.
  • rl_plugins_reload restarts every plugin.

When any plugin file changes, all plugins restart (each one’s OnUnloaded, then OnLoaded). Plugins should keep what matters in their data file, as Arena does.

Admins and admin-only plugins

Admins are the host of a lobby, the accounts with the admin claim in config/users.json (dedicated server, see the hosting guide) and the players made admin from Admin > Players. Plugins check it with IsAdmin( player ), and their admin commands answer “is for admins” to everyone else.

To keep a whole plugin for admins, whatever its own settings say, list it in rl_plugins_admin_only (server console or command line, kept from one start to the next):

rl_plugins_admin_only Give,Creative

Players who are not admins then do not see its commands, buttons, menus, HUD texts or markers, and its commands refuse them. The plugin still runs for everyone (NoMobs keeps blocking mobs). rl_plugins shows “admins only” next to it.

Groups and permissions

Plugins share groups and permissions, like on Oxide: a plugin asks “may this player use kits.vip?”, and the server owner decides who may, by putting players in groups and granting permissions to groups. Everyone is in default; admins (and members of the admin group) have every permission. A permission ending in .* grants all those under it (kits.*), * grants everything. It is all kept in plugins/permissions.json.

From the server console (or an admin’s console):

Command Does
rl_perm list Groups, their permissions, and the permissions the plugins declared
rl_perm show <player|group> A player’s groups, or a group’s permissions
rl_perm group <name> [parent] Create a group, optionally inheriting another (rl_perm group supporter, rl_perm group vip supporter)
rl_perm delete <group> Delete a group
rl_perm add <player> <group>, rl_perm remove <player> <group> Put a player in a group or take them out: a name of someone online, or a SteamID
rl_perm grant <group|player> <perm>, rl_perm revoke ... Give or take back a permission

With Groups.cs, admins do the same in game (/group, with a menu).

Only install plugins you trust. A plugin can do anything an admin can: give items, teleport, kill, kick. It cannot read or write files outside the game’s data folder, reach the internet or touch the players’ computers (the script engine blocks it).