So… my swep wont spawn and i have no idea why here’s the code:
AddCSLuaFile()
SWEP.Author = "[LB]AverageDrink"
SWEP.Instructions = "LMB to bite, RMB to go into rage mode."
SWEP.PrintName = "SCP-625 Swep"
SWEP.Purpose = "Bite your enemies to deal low damage. and go into rage mode for faster msu."
SWEP.WorldModel = "models/weapons/w_hands.mdl"
SWEP.ViewModel = "models/weapons/v_hands.mdl"
SWEP.Contact = "AverageDrink@gmail.com or through steam"
SWEP.Category = "weapon"
SWEP.AdminOnly = false
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Primary.ClipSize = 0
SWEP.Primary.DefaultClip = 0
SWEP.Secondary.ClipSize = 0
SWEP.Secondary.DefaultClip = 0
SWEP.Slot = 3
SWEP.SlotPos = 5
local maxdistance = 20
local ShootSound = Sound( "Weapon_Crossbow.BoltSkewer" )
function SWEP:Initialize()-- oof
self:GetOwner():SetHealth(trace.Entity:Health(),2250)
self:GetOwner():SetModel( "models/player/odessa.mdl" )
end
------------------------------------------------------------------------------------------
function SWEP:CanPrimaryAttack() --tells the swep if it can do anything with right click
return true
end
-------------------------------------------------------------------------------------------
function SWEP:CanSecondaryAttack() -- tells the swep if left click does anything
return true
end
-------------------------------------------------------------------------------------------
function SWEP:PrimaryAttack() -- the primary attack functions and how it works in general
self:SetNextPrimaryFire( CurTime() + 3.0 )
self:EmitSound("Weapon_Crossbow.BoltSkewer")
trace = self:GetOwner():GetEyeTrace()
if ((trace.hit == false)) then return end
trace.Entity:TakeDamage(30, self:GetOwner(), self)
end
------------------------------------------------------------------------------------------
function SWEP:SecondaryAttack() -- rage mode
self:SetNextSecondaryFire( CurTime() + 30.0 )
self:GetOwner():SetWalkSpeed(self:GetOwner():GetWalkSpeed()*2)
self:GetOwner():SetRunSpeed(self:GetOwner():GetRunSpeed()*2)
timer.Create( "RageTimer", 15, 1, function()
self:GetOwner():SetWalkSpeed(self:GetOwner():GetWalkSpeed()/2)
self:GetOwner():SetRunSpeed(self:GetOwner():GetRunSpeed()/2)
end)
end