Does anyone know the internal code for Entity:FireBullet()

I’m trying to make my own personal physical bullet and I don’t know how the spread works so I wanted to know what gmod originally does with the spread option of a bullet? I would also like to know what it does with the other options too but I don’t need too my the spread option is my only priority.

This is my code so for bullet creation that overrides Entity:FireBullet()
[lua]
Meta.FireBullets = function( self, b ) --Meta is the Entity’s Meta Table

local rand = Vector(math.Rand( -b.Spread.x, b.Spread.x ), math.Rand( -b.Spread.y, b.Spread.y),math.Rand(-b.Spread.x + -b.Spread.y,b.Spread.x + b.Spread.y)/2) --this is the main part I dunno if it really replicates original gmod code with bullets
	local newdir = b.Dir + rand

	local Bullet = ents.Create( "phys_bull" )
	Bullet:SetPos( b.Src + ( newdir * 50 ) ) --This depends on the rand arg so correct me if I'm wrong on this.
	Bullet:SetAngles( newdir:Angle( ) ) -- So is this
	Bullet.Dir = newdir --And this.
	Bullet.Force = b.Force
	Bullet.Damage = b.Damage
	Bullet.Callback = b.Callback
	Bullet.Owner = self
	Bullet:Spawn( )

end
[/lua]

Afaik its just a simple trace with an effect.

Atleast I replicated it using only,
1 trace, multiple effects(trace, impact etc), DamageInfo().

It’s basically

CUserCmd *cmd = //Code to get current CUserCmd.
unsigned int seed = MD5_PseudoRandom( cmd->command_number ); // some more fiddling about with this too.

Then ManipShot with the seed, and you now have the spread. It does this on both the server and client, drawing the trace on the client, and doing the damage on the server.