Error Handling

Is there a way of handling lua errors, so that I could tell my script to try and fix the issue? Like try…catch in other languages.

There is no try…catch statement in Lua, but consider using gm_luaerror for debugging only:
http://www.facepunch.com/showthread.php?t=859872

Damn, alright then.

Take a gander at xpcall and pcall in the documentation on lua.org. They sort of offer trapping.

[lua]local ok, err = pcall(function() – try equivalent
– do whatever here
end)
if not ok then – catch equivalent
ErrorNoHalt(err)
end[/lua]