All pastes #813877 Raw Edit

Untitled

public lua v1 · immutable
·published 2007-12-12 21:25 UTC
rendered paste body
function SWEP:ShootDart(dmg,cone)	local rcone = Angle(math.Rand(-1 * cone,cone),math.Rand(-1 * cone,cone),0)		self:TakePrimaryAmmo(1)	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) 		self.Owner:MuzzleFlash()									self.Owner:SetAnimation( PLAYER_ATTACK1 )	local ent = ents.Create("sent_poisondart")	ent:SetOwner( self.Owner )	ent:SetPos( self.Owner:GetShootPos() + self.Owner:GetAimVector() * 15 )	ent:SetAngles( self.Owner:GetAngles() + rcone )	ent:Activate()	ent:Spawn()		local start = self.Owner:GetShootPos() + self.Owner:GetAimVector() * 25	local finish = self.Owner:GetShootPos() + self.Owner:GetAimVector() * 99999	DebugMsg(" "..start.x.." "..start.y.." "..start.z.." lol")	local tracedata = {}    tracedata.start = start    tracedata.endpos = finish	tracedata.filter = self.Owner    local tr = util.TraceLine(tracedata) 		local moveto = ent:GetForward() * (tr.StartPos:Distance(tr.HitPos) * 1.65 )		ent:SetPos(moveto)end