Understanding Errors

From GMod Wiki

Jump to: navigation, search
Icon-info.png Go to:
Useful Information


Lua: Understanding Errors
Page white text.png Description:Aims to teach a little about diagnosing Lua errors.
link=User:Rambo_6 Original Author:Rambo_6
Calendar.png Created:26th March 2008

Contents

Clientside or Serverside?

If an error is written in blue, it means a portion of serverside code is erroring. This is usually more severe than a clientside error since it affects everyone in the server. Errors written in yellow are clientside, and usually not very problematic.

Interpreting Errors

Here is an example of an error: LS: Error: mygame/gamemode/init.lua:23: attempt to call method 'SendHint' (a nil value)

LS indicates that the error happened serverside. It then shows the file that it happened in, followed by the line number where the error occurred.

Attempt to call method 'SendHint' (a nil value) tells us that it failed when trying to call the function SendHint. Then it tells us that SendHint is a nil value. This means you're attempting to use a function that doesn't exist. Using the line number supplied by the error, you can go to the line in your Lua script and fix it.

Error: mygame/gamemode/init.lua is where it tells you that the error occurs on the server-side Lua script (init.lua)
And the :23: is the line number that the error is occuring on.

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox