Melee SWEPS?

So I’m trying to make a melee scripted weapon, and when I try to select a first-person veiw model for the fists, it doesn’t work in-game. For say I use the ct_arms_swat.mdl it doesn’t show in game, it’s just invisible, any tips or help?

Can you show my your code?

AddCSLuaFile()

SWEP.Author = “Stan”
SWEP.Purpose = “Enhanced Administrator Fists”
SWEP.Category = “Administrator Fists”

SWEP.Spawnable = true
SWEP.UseHands = true

SWEP.ViewModel = “models/player/gasmask.mdl”
SWEP.WorldModel = “”

SWEP.ViewModelFOV = 64

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Damage = 10000000
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.Weight = 1
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false

SWEP.PrintName = “Admin Fists”
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true

local SwingSound = Sound( “weapons/slam/throw.wav” )
local HitSound = Sound( “Flesh.ImpactHard” )

function SWEP:Initialize()

self:SetWeaponHoldType( "fist" )

end

function SWEP:PreDrawViewModel( vm, wep, ply )

vm:SetMaterial( "engine/occlusionproxy" ) -- Hide that view model with hacky material

end

SWEP.HitDistance = 67
SWEP.AttackAnims = { “fists_uppercut”, “fists_uppercut”, “fists_uppercut” }
function SWEP:PrimaryAttack()
self.Owner:SetAnimation( PLAYER_ATTACK1 )

if ( !SERVER ) then return end

-- We need this because attack sequences won't work otherwise in multiplayer
local vm = self.Owner:GetViewModel()
vm:ResetSequence( vm:LookupSequence( "fists_idle_01" ) )

local anim = self.AttackAnims[ math.random( 1, #self.AttackAnims ) ]

timer.Simple( 0, function()
	if ( !IsValid( self ) || !IsValid( self.Owner ) || !self.Owner:GetActiveWeapon() || self.Owner:GetActiveWeapon() != self ) then return end

	local vm = self.Owner:GetViewModel()
	vm:ResetSequence( vm:LookupSequence( anim ) )

	self:Idle()
end )

timer.Simple( 0.05, function()
	if ( !IsValid( self ) || !IsValid( self.Owner ) || !self.Owner:GetActiveWeapon() || self.Owner:GetActiveWeapon() != self ) then return end
	if ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( 0, 16, 0 ) )
	elseif ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( 16, -8, 0 ) )
	elseif ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( 16, -8, 0 ) )
	end
end )

timer.Simple( 0.2, function()
	if ( !IsValid( self ) || !IsValid( self.Owner ) || !self.Owner:GetActiveWeapon() || self.Owner:GetActiveWeapon() != self ) then return end
	if ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( -32, 0, 0 ) )
	elseif ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( -32, 0, 0 ) )
	elseif ( anim == "fists_uppercut" ) then
		self.Owner:ViewPunch( Angle( -32, 0, 0 ) )
	end
	self.Owner:EmitSound( SwingSound )
	
end )

timer.Simple( 0.2, function()
	if ( !IsValid( self ) || !IsValid( self.Owner ) || !self.Owner:GetActiveWeapon() || self.Owner:GetActiveWeapon() != self ) then return end
	self:DealDamage( anim )
end )

self:SetNextPrimaryFire( CurTime() + 0.9 )

end

function SWEP:DealDamage( anim )
local tr = util.TraceLine( {
start = self.Owner:GetShootPos(),
endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
filter = self.Owner
} )

if ( !IsValid( tr.Entity ) ) then 
	tr = util.TraceHull( {
		start = self.Owner:GetShootPos(),
		endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
		filter = self.Owner,
		mins = self.Owner:OBBMins() / 3,
		maxs = self.Owner:OBBMaxs() / 3
	} )
end

if ( tr.Hit ) then self.Owner:EmitSound( HitSound ) end

if ( IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() ) ) then
	local dmginfo = DamageInfo()
	dmginfo:SetDamage( self.Primary.Damage )
	if ( anim == "fists_left" ) then
		dmginfo:SetDamageForce( self.Owner:GetRight() * 49125 + self.Owner:GetForward() * 99984 ) -- Yes we need those specific numbers
	elseif ( anim == "fists_right" ) then
		dmginfo:SetDamageForce( self.Owner:GetRight() * -49124 + self.Owner:GetForward() * 99899 )
	elseif ( anim == "fists_uppercut" ) then
		dmginfo:SetDamageForce( self.Owner:GetUp() * 51589 + self.Owner:GetForward() * 100128 )
	end
	dmginfo:SetInflictor( self )
	local attacker = self.Owner
	if ( !IsValid( attacker ) ) then attacker = self end
	dmginfo:SetAttacker( attacker )

	tr.Entity:TakeDamageInfo( dmginfo )
end

end

function SWEP:SecondaryAttack()
end

function SWEP:Idle()

local vm = self.Owner:GetViewModel()
timer.Create( "fists_idle" .. self:EntIndex(), vm:SequenceDuration(), 1, function()
	vm:ResetSequence( vm:LookupSequence( "fists_idle_0" .. math.random( 1, 2 ) ) )
end )

end

function SWEP:OnRemove()

if ( IsValid( self.Owner ) ) then
	local vm = self.Owner:GetViewModel()
	if ( IsValid( vm ) ) then vm:SetMaterial( "" ) end
end

timer.Stop( "fists_idle" .. self:EntIndex() )

end

function SWEP:Holster( wep )

self:OnRemove()

return true

end

function SWEP:Deploy()
local vm = self.Owner:GetViewModel()
vm:ResetSequence( vm:LookupSequence( “fists_draw” ) )

self:Idle()

return true

end