Advertisement
WeltEnSTurm

Untitled

Jul 15th, 2010
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1.  
  2. TOOL.Category           = "Construction"
  3. TOOL.Name           = "Radius Counter"
  4. TOOL.Command        = nil
  5. TOOL.ConfigName     = ""
  6.  
  7. function TOOL:LeftClick(tr)
  8.     if !self.HitPoint then
  9.         self.HitPoint=tr.HitPos
  10.     else
  11.         local dist=tr.HitPos:Distance(self.HitPoint)
  12.         local count=0
  13.         for _,e in pairs(ents.FindInSphere(tr.HitPos, dist)) do
  14.             if e:GetClass()=="prop_physics" then
  15.                 count=count+1
  16.             end
  17.         end
  18.         self:GetOwner():ChatPrint("Count: "..count)
  19.         self.HitPoint=nil
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement