lewisclark / glua-steal

Retrieves client-sided Lua files from Garry's Mod game servers
GNU General Public License v3.0
151 stars 15 forks source link

Not working anymore #24

Closed bozoweed closed 2 years ago

bozoweed commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Expected behavior in gluasteal.lua i use hook.Add() that working fine but from few days it's broken

Screenshots

[21-11-21 - 18:04:53.686] [warning] Failed to run lua file execution error '[string "gluasteal.lua"]:40: attempt to index global 'hook' (a nil value)'

Additional details (please complete the following information):

Additional context in gluasteal.lua i use hook.Add() that working fine but from few days it's broken

lewisclark commented 2 years ago

Are you attempting to use the hook library before it is loaded? gluasteal.lua will be executed many times before the hook library is loaded, so you must first check if it has loaded before trying to call into it.

bozoweed commented 2 years ago

mine code was working great juste befor last gmod update, now nothing work

lewisclark commented 2 years ago

I've just tested this and using hook.Add is working perfectly fine for me. I can't see any breaking changes to the hook library in Garry's Mod's changelog so I can only see this being an issue with your code.

bozoweed commented 2 years ago

that was stang because it's was working great just before :/

bozoweed commented 2 years ago

--bind p Inj3check --bind o lowkey_menu --bind i TricksDoor_start if (gluasteal.SCRIPT:match("lsac")) then print("blocked script")

return false

end

if (gluasteal.SCRIPT:match("eprotect")) then print("blocked script")

return false

end

if (gluasteal.SCRIPT:match("rs50")) then print("blocked anticheat")

return false

end

if (gluasteal.SCRIPT:match("exploit")) then print("blocked anticheat")

return false

end

if (gluasteal.SCRIPT:match("anti")) then print("blocked anticheat")

return false

end

hook.Add("Initialize", "bobobobobobob", function() if (_G.ReadyBobo ~= true) then concommand.Add("dev", function() gluasteal.include("ToInject/Menu-Project/MenuProjectv1.1.lua") end) concommand.Add("bobo", function() gluasteal.include("ToInject/Inj3Menu.lua") gluasteal.include("ToInject/Inj3NB.lua") end) concommand.Add("bobo2", function() gluasteal.include("ToInject/TricksDoor.lua") end) concommand.Add("bobo3", function() gluasteal.include("ToInject/menuV2.lua") end) _G.ReadyBobo = true hook.Add("Tick", "bobobobobobobsqdsqd", function() hook.Run("Think") end) end end)``

bozoweed commented 2 years ago

sorry i don't know how to made better code parse sorry ^^'

lewisclark commented 2 years ago

Try surrounding your hook.Add block in an if hook then ... end, e.g.

if hook then
    hook.Add(...
    ...
end

That way hook.Add will only be executed when the hook library is present and loaded

bozoweed commented 2 years ago

okey thanks :)

lewisclark commented 2 years ago

Closing this as I assume this is resolved.