w_model doesnt work on swep

I just made a quick swep out of this: http://www.fpsbanana.com/skins/70539

the v_model works, but the w_model shows up as the regular ak47… what do I do??

Could we mind seeing the code for your SWEP?

I used dans npc weapons as base (because i wanted it for npcs)

– This SWEP was generated by mblunk’s swep factory.
SWEP.Base = “weapon_base”

if ( SERVER ) then
AddCSLuaFile( “shared.lua” )
SWEP.HoldType = “ar2”
end

– Visual/sound settings
SWEP.PrintName = “AKGP30”
SWEP.Category = “other”
SWEP.Slot = 2
SWEP.SlotPos = 4
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true
SWEP.ViewModelFlip = true
SWEP.ViewModelFOV = 64
SWEP.ViewModel = “models/weapons/v_rif_ak47.mdl”
SWEP.WorldModel = “models/weapons/w_rif_ak47.mdl”
SWEP.ReloadSound = “weapons/pistol/pistol_reload1.wav”
//SWEP.HoldType = “ar2”

– Other settings
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Spawnable = true
SWEP.AdminSpawnable = true

– SWEP info
SWEP.Author = “RRDRL”
SWEP.Contact = “”
SWEP.Purpose = “”
SWEP.Instructions = “”

SWEP.firepitch = 100

– Primary fire settings
SWEP.Primary.Sound = “weapons/ak47-1.wav”
SWEP.Primary.Damage = 4
SWEP.Primary.NumShots = 1
SWEP.Primary.Recoil = 1
SWEP.Primary.Cone = 12
SWEP.Primary.Delay = 0.10
SWEP.Primary.ClipSize = 30
SWEP.Primary.DefaultClip = 30
SWEP.Primary.Tracer = 1
SWEP.Primary.Force = 10
SWEP.Primary.TakeAmmoPerBullet = false
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = “SMG1”

– Secondary fire settings
SWEP.Secondary.Sound = “”
SWEP.Secondary.Damage = 10
SWEP.Secondary.NumShots = 1
SWEP.Secondary.Recoil = 1
SWEP.Secondary.Cone = 3
SWEP.Secondary.Delay = 0.01
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Tracer = 1
SWEP.Secondary.Force = 5
SWEP.Secondary.TakeAmmoPerBullet = false
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “”

– Hooks
function SWEP:Initialize()
if ( SERVER ) then
self:SetWeaponHoldType( self.HoldType )
end
end

function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end
local bullet = {} – Set up the shot
bullet.Num = self.Primary.NumShots
bullet.Src = self.Owner:GetShootPos()
bullet.Dir = self.Owner:GetAimVector()
if self.Owner:IsPlayer() then
bullet.Spread = Vector( (self.Primary.Cone / 90)/4, (self.Primary.Cone / 90)/4, 0 )
else
bullet.Spread = Vector( self.Primary.Cone / 90, self.Primary.Cone / 90, 0 )
end
bullet.Tracer = self.Primary.Tracer
bullet.Force = self.Primary.Force
if self.Owner:IsPlayer() then
bullet.Damage = self.Primary.Damage * 4
else
bullet.Damage = self.Primary.Damage
end
bullet.AmmoType = self.Primary.Ammo
self.Owner:FireBullets( bullet )
self.Owner:MuzzleFlash()
self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self.Weapon:EmitSound(Sound(self.Primary.Sound),340,self.firepitch)
//self.Owner:ViewPunch(Angle( -self.Primary.Recoil, 0, 0 ))
if !self.Owner:IsNPC() then
if (self.Primary.TakeAmmoPerBullet) then
self:TakePrimaryAmmo(self.Primary.NumShots)
else
self:TakePrimaryAmmo(1)
end
end
self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
end

function SWEP:SecondaryAttack()
end

function SWEP:Think()
end

function SWEP:Reload()
self.Weapon:DefaultReload(ACT_VM_RELOAD)
self.firepitch = math.random(94,106)
return true
end

function SWEP:Deploy()
self.firepitch = math.random(94,106)
return true
end

function SWEP:Holster()
return true
end

function SWEP:OnRemove()
end

function SWEP:OnRestore()
self.firepitch = math.random(94,106)
end

function SWEP:Precache()
end

function SWEP:OwnerChanged()
end

[editline]04:57PM[/editline]

ok, an update: in gmod, when i check the folder, the w_model looks like the normal ak, and the v_model is the modded ak.

You have the stock CSS AK as your world model because you have it set to that in.



SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"

That should be set to whatever your custom AK’s world model is.
Example…


SWEP.WorldModel = "models/weapons/w_MyModelsName.mdl"

But seeing as your view model is also the stock “V_Rif_ak47.mdl”, you most likely replaced your default ak47 model and the custom one does not have a W model.

no, but the download was an ak replacement. so its called w_rif_ak47, but in fact its the modded rifle

[editline]07:50PM[/editline]

I changed ak47 to ak74 in the shared.lua, then did the same on the models, but heck, now it shows invisible! what the?

[editline]08:47PM[/editline]

look, here is it, try to fix it if you can

http://www.garrysmod.org/img/?t=dll&id=80286

[editline]08:57PM[/editline]

Uh-oh. I checked, and even though its in addon form, it replaces the regular AK. help me guys! please fix the models!

You need to hex them. Hang on, I’ll hex them quickly.

Edit:
Question, why did you put Frags, smokes, and Flashbangs in the download as well?

There isn’t a world a model for it…?

No there is, he most likely just had it installed wrong or it was conflicting with the default ak.

i fixed it.

oh, and the grenades are because the model included replacing the grenades with the ak shooting nades and i wanted to swep em too but i failed.

now you can help me here:

http://www.facepunch.com/showthread.php?t=823932

Mmm, well… now I have a hexed model and nothing to do with it. Hmm… screw it, five minute Gmod.org swep.

Anyway, good for you mate.