Skip to content
/SLASHPLAY

How to reload a Lua file in GMod

Type lua_refresh_file autorun/server/myaddon.lua in the server console to reload that file as if it had just been saved.

lua_refresh_file

Reloads a server-side Lua file, as if it had been edited and auto-refreshed.

lua_refresh_file <path>

Examples

lua_refresh_file autorun/server/myaddon.lua

Reload one addon file.

Arguments

pathRequired
Lua file path to refresh.

What it does

Triggers the same Lua auto refresh that normally happens when a file is saved, without touching the file.

The game's own description: Manually refresh a serverside Lua script, as if it was auto refreshed by editing it.

Run it on your server

On a SLASHPLAY server, type it in the Console tab of the server page; the reply shows right under it. A value set there lasts until the server restarts. To keep it, add the line to garrysmod/cfg/server.cfg. New to this? Start a GMod server first.

Your own
GMod server.

From $0.03 an hour, only while it runs. New accounts get 6 free tokens.