Garry's Mod

Garry's Mod

1,152 ratings
Lua Patcher
5
6
6
2
3
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build
File Size
Posted
Updated
41.965 KB
20 Feb, 2021 @ 11:50pm
20 Feb @ 10:23am
48 Change Notes ( view )

Subscribe to download
Lua Patcher

Description
Formerly known as Piengineer's Lua Repair

This addon fixes the most common Lua errors, but has the potential to cause performance issues. Only use this when addon creators are unresponsive to your error reports.

Developer Note: If you want to just hide the error pop-up, follow this guide. This addon focuses more on fixing broken code.

This is basically only the Lua Error Fixer part of my old Lua and Model Error Fixers addon I made a while back as some people have requested me to separate the Lua Error Fixer from the Model Error Fixer.

What does the addon do?
The addon attempts to redefine Lua rules to prevent Lua errors from showing up by other addons. It does this by having certain Lua operations return an appropriate value instead of throwing an error.

You can think of this addon as providing a set of rules to the interpreter on how to deal with Lua errors before they even happen. As a plus, this sometimes allows broken addons to become functional again!

What can't this addon fix?
This addon does not fix model and texture errors. Try using the !*$%? ERRORS addon for fixing those.

This addon can only fix compiled Lua code. The script file itself must not have any syntax errors or it won't compile and will be invisible to this addon. I can't do anything to fix these, sorry.

Lua Repair also cannot fix errors that contain the phrase "attempt to compare X with number" or "attempt to compare X with string" due to how number and string comparisons are implemented in Lua 5.1. If Garry ever allows __lt and __le metamethods to be invoked for mixed types, this error will become fixed.

Other than the above, there will exist a way for this addon to deal with the error.

I still see Lua errors after installing this addon.
Sadly, each illegal Lua operation must be redefined one by one. If this happens, give me the first line of the error message as well as which addon did it so that I can see what operation Lua was trying to do.

Note that if you don't give me enough information about the error, I might not be able to fix it!

What chatbox is that?
The chatbox addon seen in the screenshots is the old SChat: 3D Chat Addon.

Will this trigger DRM on paid addons?
Maybe. This addon uses unavoidable getmetatable and debug.setmetatable calls for its operations. If the DRM detects the use of these functions then it will be triggered.

I don't trust this, where is your source code?
You can find / download it on my GitHub page[github.com]. You can also download this whole addon from GitHub instead of here if you're crafty enough.



If you like my work, you now have the option to donate on Ko-fi[ko-fi.com] so that I can keep working for another day. Every little bit helps!
Popular Discussions View All (1)
5
4 Feb @ 10:30am
Lua Error
Woody
381 Comments
Goatmilk_99 :D 15 Feb @ 1:58pm 
"you should update-date your addon NOW!"
The Door to Guf 7 Feb @ 12:53pm 
makes skybox turn black
Arch Tempered Ibarakasen 7 Feb @ 4:29am 
I got this error report and I still can't find which addon cause this

"Refusing to AddCSLuaFile 'autorun/wp2 gun sounds.lua' because its name contains dodgy symbols"
sigaret 5 Feb @ 9:38am 
[Lua Patcher] lua/autorun/+piengineers_lua_patcher_rewrite.lua:839: attempt to call field 'GetEnemy' (a boolean value)
1. GetEnemy - lua/autorun/+piengineers_lua_patcher_rewrite.lua:839
2. fn - lua/autorun/citizen_revenge.lua:345
3. unknown - lua/ulib/shared/hook.lua:109 (x341)

dunno if this is your mod causing this or defensive citizens.
Osa 3 Feb @ 11:15am 
new bug idk if your able to fix this due to your losing Interest.
[Lua Patcher] lua/autorun/+piengineers_lua_patcher_rewrite.lua:839: attempt to call field 'GetEnemy' (a boolean value)
1. GetEnemy - lua/autorun/+piengineers_lua_patcher_rewrite.lua:839
2. fn - lua/autorun/citizen_revenge.lua:345
3. unknown - lua/ulib/shared/hook.lua:109
Paçoca Calvo 14 Jan @ 4:32am 
this mod are so cool
Paçoca Calvo 12 Jan @ 10:43pm 
oh
Piengineer12  [author] 12 Jan @ 10:41pm 
This is not abandoned, but I'll have to admit that I'm slowly losing interest on this
Paçoca Calvo 12 Jan @ 7:41pm 
this mod are abandoned?
Rasmordem 4 Jan @ 1:24pm 
@Piengineer12

Sorry for the late response, I have two other addons that modify default LUA.

Srlion's Hook Library
gLua Patches (Which depends on the above one)