Swep problems

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


You are missing a comma in your SetHealth call. Please check console for errors and include them with your code in the future. Also, wrap your code with [noparse]




[/noparse]

gotcha

[editline]17th September 2017[/editline]

This is the error log i was given when running it in console…]
lua_openscript weapon_anklebiter.lua
Running script weapon_anklebiter.lua…
Couldn’t include file ‘weapon_anklebiter.lua’ (File not found) (<nowhere>)

Where did you put the file?

in this file directory path C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\anklebiter\lua\weapons

[editline]17th September 2017[/editline]

did i do something wrong here or?.. I’m just really lost as it cant find the file at all

Why does addons have a space between a and ddons?

because facepunch in the edit it looks fine and in the actual file explorer there is no space.

I really need to check what I write…

[editline]17th September 2017[/editline]

Lua_openscript only works for files in the lua folder located at: C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua

Then what should i do then

[editline]17th September 2017[/editline]

what would i use to run it then good sire?

Right now it should load automatically. So I don’t understand what you want…?

My problem is i cant find or spawn it in to the game