Swep code or a tutorial

Hey guys, I was wondering if anyone had a base code or the default code for a Swep i’m just making some melee weapons…

[editline]7th January 2013[/editline]

i realised that the tutorial is quite old, but it will still work. just read over the changes from 12 -> 13 and find out what needs to be replaced (ie i think garry changed language.Add or something)

It uses 3 files… Shared.lua should be the only one there, thats a very old tutorial

No… init.lua and cl_init.lua are also required for certain features.

Oh well i’m just making a melee weapon

[editline]8th January 2013[/editline]

and a pistol that shoots strider bullets that vaporises people

It’s purely optional to use either just shared.lua, or all 3. In GM12, with dua being sent in plain text, I found it better to have 3 so someone couldn’t just completely copy+paste a swep you made. “shared” means it exists both clientside and serverside. init is serverside, cl_init is clientside. There’s not really any advantage (as far as I know) to using either method over the other, both work.