Skip to content
Fix It

Fix Garry's Mod Lua Errors

What Garry's Mod Lua errors and script errors mean, clientside vs serverside, how to find the addon causing them and how to report one to its author.

Updated 5 min read

A Lua error means an addon's code tried something that didn't work. The game keeps running, but that addon's feature may break. The error tells you which file broke, and that file tells you which addon to fix, disable or report.

The Script Error Box

When an error happens, a box appears in the top left of your screen. It says one of these:

  • "Something is creating script errors, check the Problems menu for details"
  • "The addon "..." is creating errors, check the Problems menu for details"

When the game can tell which addon caused it, the box names it. When it can't, you get the "Something" version.

Open the Problems Menu

The Problems menu lists every Lua error since you started the game.

Open the Main Menu

Press Escape. If a server's own menu opens instead, hold Shift and press Escape to force the Garry's Mod main menu.

Click Problems

The Problems button is in the bottom right, next to the game controller icon. A number on it shows how many problems the game found.

Read the Lua Errors List

Each error shows its text, how many times it happened, and a Copy button. If the game knows the addon, you also get buttons to open it on the Workshop, disable it or uninstall it.

How to Read an Error

Here's an example error from the Garry's Mod wiki:

[ERROR] addons/my_addon/lua/autorun/server/sv_my_addon_autorun.lua:2: attempt to call global 'Print' (a nil value)
  1. unknown - addons/my_addon/lua/autorun/server/sv_my_addon_autorun.lua:2
PartMeaning
addons/my_addon/...The file that broke. The folder after addons/ is often the addon's name.
:2The line in that file
attempt to call global 'Print' (a nil value)What went wrong
The numbered lines belowThe stack: which code called the broken code

You don't need to understand the message to fix it. You need the file path, so you know whose addon it is.

Common Error Messages

MessageWhat it means
attempt to call global '...' (a nil value)The code called a function that doesn't exist. Often another addon it needs is missing.
attempt to index global '...' (a nil value)The code used something that was never set up. Often a missing or broken required addon.
attempt to perform arithmetic on ...The code tried to do maths on something that isn't a number.
unexpected symbol near ...The file has a typo, so none of it runs.
'end' expected near '<eof>'The file ends before its code is closed off.
Couldn't include file '...' - File not foundA file is missing, or a server added it while running.

Clientside or Serverside

Every Lua error happens on one side, and the console colours it by side:

ColourSideWho can fix it
YellowClientside: code running on your PCYou, if it's your addon. The server, if it came from the server.
BlueServerside: code running on the serverThe server owner. You'll see these in singleplayer or when you host.
GreenThe main menu's own codeRare. Note it and report it.

Red or white text that looks like an error isn't a Lua error. That's the engine itself.

On someone else's server, the errors you see are clientside. The server's own errors show in its console, not yours.

Find Which Addon Causes It

Read the Path

The path in the error usually names the addon folder. The Problems menu names Workshop addons for you.

Test Without Your Addons

Add -noworkshop to your launch options to start without Workshop addons. In Steam, right-click Garry's Mod, click Properties, then type it under Launch Options on the General tab. -noaddons does the same for addons you installed by hand.

Narrow It Down

If the errors stop, one of your addons is the cause. Remove -noworkshop, then open Addons and disable half your subscriptions. Restart and test again. Keep halving until you find the one.

Disable or Update It

Disable the addon, or check its Workshop page for an update or a known fix.

If the errors only happen on one server and not in singleplayer, it's that server's code. Your own addons are usually not the cause. Report it to the server instead.

Report an Error

Copy the full error with the Copy button in the Problems menu. Paste the text, not a screenshot.

A good report has:

  • The full error text, including the numbered lines
  • What you were doing when it happened
  • Which server you were on, or that it was singleplayer
  • The addon's name, if you know it

Send it to whoever owns the code:

  • A Workshop addon: post on the addon's Workshop page, in its comments or bug discussion.
  • A server's addon: use the server's bug report command, Discord or forum. On Justified, type /bug in chat.

To save a long error to a file, add -condebug to your launch options. The game then writes everything in the console to console.log in your garrysmod folder.

If the game closes instead of showing an error, go to Garry's Mod Keeps Crashing. For more console commands, see the console reference.

Want a server to try it on? Justified is a Garry's Mod DarkRP server: justified.gg.

More in Fix It

All Fix It