• Poly.
    10 replies, posted
Ok, so after garry's mod wiki. This is supposed to create a triangle at the top left screen. [lua]local triangle = { { x = 100, y = 200 }, { x = 150, y = 100 }, { x = 200, y = 200 } } hook.Add( "HUDPaint", "PolygonTest", function() surface.SetDrawColor( 255, 0, 0, 255 ) draw.NoTexture() surface.DrawPoly( triangle ) end )[/lua] Well, i made it into cl_init.lua in lua/autorun/client and nothin happens. Any ideas? [editline]3rd July 2016[/editline] [url]http://wiki.garrysmod.com/page/surface/DrawPoly[/url]
I don't call myself even a beginning coder but it looks like you're missing a bracket.
No?
You need to run the script by typing lua_autorun_cl [I]PATHTOFILE[/I]
cl_init.lua is a pretty common filename, so it could be conflicting with something else. You really shouldn't be calling anything that unless it's part of its own entity/swep/gamemode. You could also try changing the hook name to something other than "PolygonTest", as it's not impossible that someone copied the same example into their addon and forgot to change that.
Ill try, and moku this is for our server. I am testing it on a dev server, not singleplayer. [editline]3rd July 2016[/editline] The server has no addons other than that tho [editline]3rd July 2016[/editline] Nah, didnt work
I did the exact same thing you did except changed the filename to something other than cl_init.lua and it worked for me. [t]http://i.imgur.com/fYROjjy.jpg[/t] You renamed the file, the hook, and restarted your server, right?
Can you send me your code? And i have a very small screen for the moment
[QUOTE=SlayerLegendz;50645818]Can you send me your code? And i have a very small screen for the moment[/QUOTE] It's the same code, different hook name and filename.
Then what the heck am i doing wrong..
[QUOTE=SlayerLegendz;50699030]Then what the heck am i doing wrong..[/QUOTE] [QUOTE=timz9;50648591]It's the same code, different hook name and filename.[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.