• Lua Hook.Add not working on Gmod 13 ?
    2 replies, posted
Hello Forum, I started Lua coding today and first of wanted to create some new HUD elements. I used a snippet from a Tutorial which just wouldn't work for me. I also tried other Tutorials from the Gmod Wiki on maurits.tv. They all end up the same. No error in the console, nothing happening on the screen. Why is this not working anymore ? Here is the code snippet in question: [CODE] function RoundedBoxHook() draw.RoundedBox( 8, 5, ScrH()-105, 250, 100, Color(0, 0, 0, 180) ); end hook.Add("HUDPaint", "RoundedBoxHud", RoundedBoxHook) [/CODE] What do I need to change for it to work as supposed ? (Expected Output is described on [URL]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index96fe.html[/URL]) I appreciate any help on getting this running with Gmod 13 edit: For anyone asking the files are within the Garrysmod/garrysmod/lua folder as "XYZ.lua" and executed ingame with lua_openscript XYZ.lua. I also tried lua_openscript_cl XYZ.lua
That script should work fine, assuming you're running it on the client. Try throwing it into lua/autorun/client/XYZ.lua
That script work just fine and draws a box around the health. It is a clientside script and should be ran on the client. Try placing it in lua/autorun/client
Sorry, you need to Log In to post a reply to this thread.