Swep Making

Ok, so I have edited a code from gmod.org (garrysmod.org) and need some help. I replaced the model that was in before, the tool gun, and made it a ban hammer model. But the guy does not hold it in his hand, its in his chest (Wtf?). If someone could help me with it, that would be great.

Kickban_gun:

Ban hammer models:



// Variables that are used on both client and server
SWEP.Author			= "mentos_mint"
SWEP.Contact		= ""
SWEP.Purpose		= "Kick/Ban Gun for Admins"
SWEP.Instructions	= "Primary kicks, while Secondary bans."

SWEP.ViewModelFOV	= 62
SWEP.ViewModelFlip	= false
SWEP.ViewModel		= "models/EnhancedAi/ban_hammer.mdl"
SWEP.WorldModel		= "models/EnhancedAi/ban_hammer.mdl"
SWEP.AnimPrefix		= "pistol"
SWEP.ShootSound		= Sound( "Airboat.FireGunRevDown" )
SWEP.HoldType 		= "Melee"

SWEP.Spawnable			= false
SWEP.AdminSpawnable		= true

SWEP.Primary.ClipSize		= -1				// Size of a clip
SWEP.Primary.DefaultClip	= -1				// Default number of bullets in a clip
SWEP.Primary.Automatic		= false			// Automatic/Semi Auto
SWEP.Primary.Ammo			= "Pistol"

SWEP.Secondary.ClipSize		= -1				// Size of a clip
SWEP.Secondary.DefaultClip	= -1				// Default number of bullets in a clip
SWEP.Secondary.Automatic	= false			// Automatic/Semi Auto
SWEP.Secondary.Ammo			= "Pistol"

function SWEP:PrimaryAttack()
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
	self.Weapon:EmitSound( self.ShootSound )
	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
	//Traceline.
	local vStart = self.Owner:GetShootPos()
	local vForward = self.Owner:GetAimVector()
	local trace = {}
	trace.start = vStart
	trace.endpos = vStart + (vForward * 2048)
	trace.filter = self.Owner	
	local tr = util.TraceLine( trace )
	if !tr.Entity:IsValid() then return end
	//If a player and not an admin, kick them.
	if tr.Entity:IsPlayer() and !tr.Entity:IsAdmin() then
		game.ConsoleCommand( "kickid " .. tr.Entity:SteamID() .. "
" )
	end
end

function SWEP:SecondaryAttack()
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
	self.Weapon:EmitSound( self.ShootSound )
	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
	//Traceline.
	local vStart = self.Owner:GetShootPos()
	local vForward = self.Owner:GetAimVector()
	local trace = {}
	trace.start = vStart
	trace.endpos = vStart + (vForward * 2048)
	trace.filter = self.Owner	
	local tr = util.TraceLine( trace )
	if !tr.Entity:IsValid() then return end
	//If a player and not an admin, kick and ban them.
	if tr.Entity:IsPlayer() and !tr.Entity:IsAdmin() then
		game.ConsoleCommand( "banid " .. tr.Entity:SteamID() .. " 0
" )
		game.ConsoleCommand( "writeid
" )
		game.ConsoleCommand( "kickid " .. tr.Entity:SteamID() .. "
" )
	end
end


  1. this banhammer Model has no viewmodel.
  2. this model isnt made for sweps.
  3. you cant use a world model as a viewmodel.

Indeed, if you wanted to use it like that, you’d have to animate it.

Damn it… Well could someone help me out here? Im really stumped, I dont do lua, I map. o.o