Can't seem to hex SWEP models, not even following tutorials
4 replies, posted
I'm following tutorials on Youtube and forums but can't seem to hex any of my weapons and they just stay floating in my crotch I've verified Gmod and CSS caches, downloaded the world models from source and placed them in the models/weapons folders, changed multiple times the names including the ones inside the .mdl with XVI32 but nothing seems to work. Do I have to write something in the Lua file or I'm not doing something right?
SWEP is Scripted WEaPon
If you add models to GMod you will just have props of their models in SpawnMenu
I mean I have already coded the weapon its fully functional in first person but the worldmodel just floats in my crotch in third person.
Post your code. Maybe it needs attachment bone
SWEP.Author = "Russian Lad"
SWEP.Base = "weapon_base"
SWEP.PrintName = "FN FAL"
SWEP.Slot = 2
SWEP.SlotPos = 0
SWEP.ViewModel = "models/weapons/v_sam_fnfal.mdl"
SWEP.ViewModelFlip = false
SWEP.UseHands = true
SWEP.WorldModel = "models/weapons/w_sam_fnfal.mdl"
SWEP.SetHoldType = "ar2"
SWEP.CSMuzzleFlashes = true
SWEP.ViewModelFOV = 75
SWEP.Category = "Russian Lad"
SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = false
SWEP.DrawTracers = true
SWEP.Spawnable = true
SWEP.AdminSpawnable = false
function SWEP:Initialize()
self:SetWeaponHoldType("ar2")
end
SWEP.Primary.ClipSize = 20
SWEP.Primary.DefaultClip = 20
SWEP.Primary.Ammo = "SniperPenetratedRound"
SWEP.Primary.Automatic = true
SWEP.Primary.Recoil = 0.33
SWEP.Primary.Damage = 41
SWEP.Primary.NumShots = 1
SWEP.Primary.Spread = 0.003
SWEP.Primary.Cone = 0
SWEP.Primary.Delay = 0.1
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.Automatic = false
SWEP.ShouldDropOnDie = false
local FireSound = Sound( "weapons/fnfal.wav" )
function SWEP:Deploy()
self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
self:SetNextPrimaryFire(CurTime() + 0.9 )
end
function SWEP:PrimaryAttack()
if( not self:CanPrimaryAttack() ) then
return
end
local Bullet = {}
Bullet.Num = self.Primary.NumShots
Bullet.Spread = Vector( self.Primary.Spread, self.Primary.Spread, 0 )
Bullet.Src = self.Owner:GetShootPos()
Bullet.Dir = self.Owner:GetAimVector()
Bullet.Tracer = 1
Bullet.Damage = self.Primary.Damage
Bullet.AmmoType = self.Primary.Ammo
self:EmitSound( FireSound )
self:FireBullets ( Bullet )
self:ShootEffects()
self.BaseClass.ShootEffects( self )
self:TakePrimaryAmmo( 1 )
self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self.Owner:ViewPunch( Angle( -0.2, 0, 0.2 ) )
if ( (game.SinglePlayer() and SERVER) or ( !game.SinglePlayer() and CLIENT and IsFirstTimePredicted() ) ) then
local eyeang = self.Owner:EyeAngles()
eyeang.yaw = eyeang.yaw - math.random(self.Primary.Recoil * -1.8, self.Primary.Recoil / 3)
eyeang.pitch = eyeang.pitch - math.random(self.Primary.Recoil * 5, self.Primary.Recoil / 3)
self.Owner:SetEyeAngles( eyeang )
end
end
function SWEP:SecondaryAttack()
return
end
function SWEP:Reload()
if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end
if ( self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
self:DefaultReload( ACT_VM_RELOAD )
local AnimationTime = self.Owner:GetViewModel():SequenceDuration()
self.ReloadingTime = CurTime() + AnimationTime
self:SetNextPrimaryFire(CurTime() + AnimationTime)
self:SetNextSecondaryFire(CurTime() + AnimationTime)
end
end
Sorry, you need to Log In to post a reply to this thread.