Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. AddCSLuaFile( "cl_init.lua" )
  2. AddCSLuaFile( "shared.lua" )
  3.  
  4. include("shared.lua")
  5.  
  6. function ENT:Initialize()
  7. self:SetUseType( SIMPLE_USE )
  8. self:SetModel( "models/props_junk/garbage_metalcan001a.mdl" )
  9. self:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics,
  10. self:SetMoveType( MOVETYPE_VPHYSICS ) -- after all, gmod is a physics
  11. self:SetSolid( SOLID_VPHYSICS )
  12. self:SetColor(Color( 153,51, 255 )) -- Toolbox
  13.  
  14. local phys = self:GetPhysicsObject()
  15. if (phys:IsValid()) then
  16. phys:Wake()
  17. end
  18. end
  19.  
  20. function ENT:Use( activator, caller )
  21.  
  22. end
  23.  
  24. function ENT:SpawnFunction( ply, tr, ClassName )
  25.  
  26. if ( !tr.Hit ) then return end
  27.  
  28. local SpawnPos = tr.HitPos + tr.HitNormal * 16
  29.  
  30. local ent = ents.Create( ClassName )
  31. ent:SetPos( SpawnPos )
  32. ent:SetBallSize( math.random( 16, 48 ) )
  33. ent:Spawn()
  34. ent:Activate()
  35.  
  36. return ent
  37.  
  38. end
  39.  
  40. function ENT:Think()
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement