Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 17th, 2012  |  syntax: Lua  |  size: 0.56 KB  |  views: 49  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function EFFECT:Init(data)
  2.         local start,endp = data:GetOrigin(),data:GetStart()
  3.         local ent = data:GetEntity()
  4.        
  5.         self.Entity = ent
  6.         self.StartPos = start
  7.         self.EndPos = endp
  8.        
  9.         self.Material = Material("Effects/laser1.vmt")
  10. end
  11.  
  12. function EFFECT:Think()
  13.         if (not self.Entity) or (self.Entity and not ValidEntity(self.Entity)) then
  14.                 return false
  15.         end
  16.        
  17.         return true
  18. end
  19.  
  20. function EFFECT:Render()
  21.         render.SetMaterial(self.Material)
  22.                
  23.         render.DrawBeam( self.EndPos,          
  24.                         self.StartPos,
  25.                 8,                                     
  26.                 1,                                     
  27.                 0,                             
  28.                 Color(255,0,0,150) )
  29. end