SWEP Melee Weapon doesn't work !

Hi all !

I have a problem with my swep melee weapon : it doesn’t animated in third person D:

Can you help me ?

init.lua



AddCSLuaFile( "cl_init.lua" );
AddCSLuaFile( "shared.lua" );

resource.AddFile("models/wrepons/v_crowbar.mdl");
resource.AddFile("models/wrepons/w_crowbar.mdl");

resource.AddFile("materials/models/weapons/v_wrench/Wrench_H4wk.vtf");
resource.AddFile("materials/models/weapons/w_wrench/Wrench_H4wk.vmt");

include('shared.lua');
 
SWEP.Weight			= 5
SWEP.AutoSwitchTo	= false
SWEP.AutoSwitchFrom	= false
SWEP.HoldType = "melee"


cl_init.lua



include('shared.lua')
 
SWEP.PrintName      = "FOW Wrench"			
SWEP.Slot			= 3
SWEP.SlotPos		= 1
SWEP.DrawAmmo		= false
SWEP.DrawCrosshair	= true


shared.lua



SWEP.Author				= "Wamilou"
SWEP.Contact			= ""
SWEP.Purpose			= ""
SWEP.Instructions		= "Wrench used in Front of War mod"
 
SWEP.Spawnable			= true
SWEP.AdminSpawnable		= true
 
SWEP.ViewModel			= "models/wrepons/v_crowbar.mdl"
SWEP.WorldModel			= "models/wrepons/w_crowbar.mdl"

SWEP.Category			= "Front of War"
SWEP.DrawCrosshair 		= true;
 
SWEP.Primary.ClipSize		= -1
SWEP.Primary.DefaultClip	= -1
SWEP.Primary.Automatic		= true
SWEP.Primary.Ammo		= "none"
 
SWEP.Secondary.ClipSize	= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo		= "none"

SWEP.base = "weapon_base"
SWEP.HoldType = "melee"

function SWEP:Initialize() 
	self:SetWeaponHoldType( self.HoldType );
	
	self.ActivityTranslate = {}
	self.ActivityTranslate[ACT_HL2MP_IDLE] = ACT_HL2MP_IDLE_MELEE
	self.ActivityTranslate[ACT_HL2MP_WALK] = ACT_HL2MP_WALK_MELEE
	self.ActivityTranslate[ACT_HL2MP_RUN] = ACT_HL2MP_RUN_MELEE
	self.ActivityTranslate[ACT_HL2MP_IDLE_CROUCH] = ACT_HL2MP_IDLE_MELEE
	self.ActivityTranslate[ACT_HL2MP_WALK_CROUCH] = ACT_HL2MP_WALK_CROUCH_MELEE
	self.ActivityTranslate[ACT_HL2MP_GESTURE_RANGE_ATTACK] = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
	self.ActivityTranslate[ACT_HL2MP_GESTURE_RELOAD] = ACT_HL2MP_GESTURE_RELOAD_MELEE
	self.ActivityTranslate[ACT_HL2MP_JUMP] = ACT_HL2MP_JUMP_MELEE
	self.ActivityTranslate[ACT_RANGE_ATTACK1] = ACT_RANGE_ATTACK_MELEE
end

function SWEP:PrimaryAttack()

	local trace = self.Owner:GetEyeTrace();
	self.Weapon:EmitSound("weapons/iceaxe/iceaxe_swing1.wav");
	self.Owner:SetAnimation( PLAYER_ATTACK1 );

	if (trace.HitPos:Distance(self.Owner:GetShootPos()) <= 75) then
		self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER);
		
		local rand = math.Round( math.random(1, 2.4) );
		
		self.Weapon:EmitSound(string.format("weapons/crowbar/crowbar_impact%i.wav", rand) );
		
		self.Owner:GetEyeTrace().Entity:TakeDamage(15,self.Owner);
		
	else		
		self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER);
	end
	
	self:SetNextPrimaryFire( CurTime() + 0.5 );

end
 
function SWEP:SecondaryAttack()
	
	local trace = self.Owner:GetEyeTrace();
	
	if(trace.Entity:IsValid() and trace.Entity.IsTakeable == true) then
	end
end

function SWEP:Reload()
	
end


Up !

No one is answering cause they don’t want to read code in none LUA tags… Just place the code bellow in the primary attack function, it’ll make the player do the attack animation.[LUA]self.Owner:SetAnimation(PLAYER_ATTACK1)[/LUA]

The problem is which my swep is set to normal and not to melee …

Up !

Double up ! D: I need some help over here …