Garry's Mod Icon GMod Thread

Custom Bullet Spread?

Hey, you! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Yttrium the Femtillionth points.
  • Post: Give Yttrium the Femtillionth your thoughts on this Thread.
  • Flag: Alert moderators and warn members of a problem with this Thread.
  • Watch: Get notified when this Thread is updated.
Mascot

Join the community!

Become a Bananite

Already a Bananite? Login

So basically, I'm working on something that I actually plan to release. Right now I'm trying to get purely horizontal bullet spray. None of that fancy TFA "WOAH, PRECALCULATED ACCURACY" shit. I already know that bullet.Spread is a vector value, but if I remove the Y value there's still vertical spray. Can anyone help me?

   -- Bullet properties
function SWEP:ShootBullet( damage, recoil, numbul, cone, bforce, btracer )

	numbul 	= numbul 	or 1
	cone 	= cone 		or 0.01

	local bullet = {}
	bullet.Num 		= numbul
	bullet.Src 		= self.Owner:GetShootPos()
	bullet.Dir 		= self.Owner:GetAimVector()
	bullet.Spread 	= Vector( cone, 0, 0 )
	bullet.Tracer	= 0
	bullet.Force	= bforce
	bullet.Damage	= damage
	
	self.Owner:FireBullets( bullet )
	
	if ( self.Owner:IsNPC() ) then return end
	
		self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
		self.Owner:MuzzleFlash()
		self.Owner:SetAnimation( PLAYER_ATTACK1 )

end

Posts

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Submitter

Send a Private Message to the submitter

Category

Stats

Posts
0
Views
991
Date Added
11mo