Python1320

derp

May 28th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local EFFECTNAME="test1"
  2.  
  3. concommand.Add('test_effect',function(pl,_,param)
  4.     MsgN('New EffectData: Ent:',pl:GetEyeTrace().Entity," Pos:",pl:GetEyeTrace().HitPos," Pl:",pl)
  5.     local e = EffectData()
  6.     e:SetOrigin(pl:GetEyeTrace().HitPos)
  7.     e:SetNormal(pl:GetEyeTrace().HitNormal)
  8.     e:SetEntity(pl:GetEyeTrace().Entity)
  9.     e:SetScale(tonumber(param[2]) or 1)
  10.     e:SetRadius(tonumber(param[3]) or 1)
  11.     e:SetAngle(pl:EyeAngles())
  12.     util.Effect(param[1] or EFFECTNAME,e)
  13. end)
  14.  
  15. if SERVER then return end local EFFECT = {}
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. function EFFECT:Init( data )
  24.    
  25.     self:SetPos(data:GetOrigin())
  26.  
  27.     self:SetModel"models/props_junk/PopCan01a.mdl"
  28.     self:PhysicsInit(SOLID_VPHYSICS)
  29.     self:SetSolid(SOLID_VPHYSICS)
  30.     self:SetSolid(COLLISION_GROUP_DEBRIS)
  31.     local pobj= self:GetPhysicsObject()
  32.     if pobj:IsValid() then
  33.         pobj:Wake()
  34.     end
  35.    
  36. end
  37.  
  38.  
  39. function EFFECT:Think()
  40.     Msg"."
  41.     return true
  42. end
  43.  
  44.  
  45. function EFFECT:Render()
  46.     self:DrawModel()
  47. end
  48.  
  49.  
  50.  
  51.  
  52. effects.Register(EFFECT,EFFECTNAME,true)
Advertisement
Add Comment
Please, Sign In to add comment