SWeaps not working

Hello. I am working on an SCP-RP server, and I have created a number of SWeaps.

All of them say “Scripted Weapon” and do not work.

I will show one of them, and it is located in (Server)/garrysmod/addons/scp/lua/weapons/hands

here is the cl_init.lua located under the directory mentioned above.



-----------------------------------------------------
include("shared.lua")
SWEP.Category 				= "SCP"
SWEP.PrintName      		= "Hands"
SWEP.Author        			= "zoidBergh"
SWEP.Contact 				= "zoidBergh"
SWEP.Instructions 			= "Right click to knock."
SWEP.ViewModel 				= "models/weapons/v_crowbar.mdl"

function SWEP:SecondaryAttack() return end
function SWEP:PrimaryAttack() return end




and here is the shared.lua:



-----------------------------------------------------
SWEP.WorldModel 		= ""
SWEP.HoldType 			= "normal"
SWEP.Spawnable			= true
SWEP.canDrop 			= false

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1

SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"

SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"

function SWEP:Deploy()
	self.Owner:DrawViewModel(false)
end

function SWEP:Initialize()
	self:SetHoldType("normal")
end



As you can see, this sweap is pretty simple, however I have some others that are structured and formatted the same, but still get the same error as this one.

I do not get any kind of errors, so any help in realizing the problem would be great!

Give this guide on the Garry’s Mod Wiki a look, it shows you how to make a simple SWEP; https://wiki.garrysmod.com/page/Chair_Throwing_Gun

But to actually answer your question, your SWEP variables need to be defined in a shared file (shared.lua), instead you are only defining them in a client file (cl_init.lua)

As you could see, the cl_init.lua did reference the shared.lua, and I combined the two files to no avail.

You need to also send the client the code:

I literally done what I told you to do, and it works fine.

I created a file called weapon_scp_hands.lua in the follow directory; lua/weapons

http://i.imgur.com/Omdvsid.jpg

My exact code is this;



AddCSLuaFile()

SWEP.PrintName      		= "Hands"
SWEP.Category 				= "SCP"
SWEP.Author        			= "zoidBergh"
SWEP.Contact 				= "zoidBergh"
SWEP.Instructions 			= "Right click to knock."

SWEP.ViewModel 				= "models/weapons/v_crowbar.mdl"
SWEP.WorldModel 			= ""

SWEP.HoldType 				= "normal"
SWEP.Spawnable				= true
SWEP.canDrop 				= false

SWEP.Primary.Automatic 		= false
SWEP.Primary.Ammo 			= "none"
SWEP.Primary.ClipSize 		= -1
SWEP.Primary.DefaultClip 	= -1

SWEP.Secondary.Automatic 	= false
SWEP.Secondary.Ammo 		= "none"
SWEP.Secondary.ClipSize 	= -1
SWEP.Secondary.DefaultClip 	= -1

function SWEP:SecondaryAttack()
	return
end

function SWEP:PrimaryAttack()
	return
end

function SWEP:Deploy()
	self.Owner:DrawViewModel( false )
end

function SWEP:Initialize()
	self:SetHoldType( "normal" )
end


Again, please refer to the wiki next time