All pastes #733893 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-12 04:55 UTC
rendered paste body
local SCAN_RANGE = 350
function ENT:Scan( )
	local scan_ents = ents.FindInSphere(self.Entity:GetPos(), SCAN_RANGE)

        local LHP = 10 ^ 63
        self.Target = self.Entity
	for k, v in pairs(scan_ents) do
		if v:Health() < LHP then
			LHP = v:Health()
			self.Target = v
		end
	end
   
end