Closed bozoweed closed 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.
mine code was working great juste befor last gmod update, now nothing work
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.
that was stang because it's was working great just before :/
--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)``
sorry i don't know how to made better code parse sorry ^^'
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
okey thanks :)
Closing this as I assume this is resolved.
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