Some Hooks only run when Code is saved and auto-loaded again.
2 replies, posted
I try to use the SetupWorldFog and SetupSkyboxFog Hooks, but they only run when i save the code in the editor and gmod runs it again.
The 'reload' command does not change anything.
As a simplified version of my problem i created fogg.lua in addons\addon_name\lua\autorun\client
hook.Add("SetupWorldFog", "WFogRender", WFogRender )
hook.Add("SetupSkyboxFog", "SkyFogRender", SkyFogRender)
print("SkyFogRender is being called")
print("WFogRender is being called")
I've tested it in Sandbox and terrortown.
Am i missing something? Do i have to call something first?
Why do the hooks get called once i save the file?
I would appreciate you help.
because the functions don't exist when you add the hooks. Define the functions before you add the hooks and make the functions local.
I feel very stupid right now.
Thank you for the quick response.
Im used to Java and C# taking care of me...
Sorry, you need to Log In to post a reply to this thread.