Well i’ve been trying to learn LUA the past few days and what i decided to start with was to get somthing to work, so i found the old gmod wiki with all the lua tutorials, and one of them was “your first scripted SWEP”.
And i was like, Cool.
So i started going through it and doing just as it said.
So this is where my problem comes, when start up a map on gmod, and i go into console and type lua_openscript “chair_thrower.lua” and i get this as a response:
[lua\chair_thrower.lua:7] attempt to index global ‘SWEP’ (a nil value)
The weapon wont even load.
After trying to fix this for some time i got tierd of it and i copied the tutorial rigth off, guess what, same result.
so im thinking my gmod is either broke or im just horribly noobie and missed somthing very basic.
Oh yeah, also tried running it from lua/autorun/client but got the same results.
So any ideas my LUA gods?