Making SWEP's Spawnable

OK I’ve been playing Garry’s Mod for a few months now, and I started programming in Lua. I’m completely new to it, but the Garry’s Mod Wiki at is helping me along. I’ve followed their tutorials to create a basic SWEP, but I don’t know how to make it “spawnable” from the menu. I want to be able to actually use it, but I don’t know how. Please help!

I’m pretty sure you have to create an addon out of it.

Well, what did you get done? You’re being a bit vague. Did you just finish the .lua? Did you move it into the proper folders?

I finished the shared, cl_init, and init lua files, and put them in a folder which is the name of my SWEP. Then I put that folder in C:/Program Files(x86)/steam/steamapps/ajminifigure/garrysmod/garrysmod/lua

Make sure you put your swep inside the lua/weapons if there isn’t a weapons folder then just create one. Also make sure you have:
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
Inside your shared.lua

OK thanks it worked!

Wow I thought it worked. Now it’s saying “function argument expected near if” or something like that.

There’s something wrong with the swep code then.