• Error Remover?
    4 replies, posted
I honestly had enough of those, if i spawn something that has an ERROR, i can't delete it somehow, i recently loaded a save from another person (Toybox) and theres an ERROR for example. Is there a way to delete it? Clean Up User addon for that maybe? Thanks in advance.
[url]http://www.facepunch.com/threads/859872-gm_luaerror-Hook-to-Lua-s-error-display[/url] [editline]19th June 2011[/editline] You need to copypaste a simple lua script from the thread for it to remove errors [editline]19th June 2011[/editline] [code]require("luaerror") lua_showerrors = CreateConVar("lua_showerrors", 1) hook.Add("LuaError", "LE", function(err) --Return anything other than nil to stop the standard error display local var = lua_showerrors:GetInt() if (var == 0) then return false elseif (var == 1) Msg(err) return false end end )[/code] This to autorun
[QUOTE=superstepa;30547784][url]http://www.facepunch.com/threads/859872-gm_luaerror-Hook-to-Lua-s-error-display[/url] [editline]19th June 2011[/editline] You need to copypaste a simple lua script from the thread for it to remove errors [editline]19th June 2011[/editline] -code- This to autorun[/QUOTE] I may be wrong, but I think he was referring to the red ERROR sign that is created when a missing model is spawned? If so, I'm pretty sure you could do something like this: [lua] concommand.Add("removeerrors", function(ply, command, args) for k,v in pairs(ents.FindByModel("models/error.mdl")) do if ValidEntity(v) then v:Remove() end end end) [/lua](untested, but pretty sure it'll work. Place it in a server side file (lua/autorun/server) and then run "removeerrors")
You can delete the error its just the error model has a tiny hit box. You have to aim right at the bottom in the middle and you can remove it that way. But what jimbodude said will also remove all the error signs.
Use this Goes in [release] garrysmod/lua/autorun/server/noerror.lua [/release] [lua]hook.Add( "PlayerSpawnEffect", "RefusepropErrspawn", function(ply,effect) return effect != "models/error.mdl" // Don't spawn the error end)[/lua]
Sorry, you need to Log In to post a reply to this thread.