Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3.  
  4. include("shared.lua")
  5.  
  6.  
  7. function ENT:SpawnFunction( ply, tr )
  8.  
  9.     if ( !tr.Hit ) then return end
  10.    
  11.     local SpawnPos = tr.HitPos + tr.HitNormal * 16
  12.    
  13.     local spawner = ents.Create( "weapon_rpg_spawner" )
  14.         spawner:SetPos( SpawnPos )
  15.         spawner:Spawn()
  16.         spawner:Activate()
  17.         print( "lol" )
  18.  
  19.    
  20.     return ent
  21.    
  22. end
  23.  
  24. function ENT:Initialize()
  25.     self.Entity:SetModel("models/props/de_prodigy/ammo_can_02.mdl")  
  26.     self.Entity:PhysicsInit(SOLID_VPHYSICS)
  27.     self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
  28.     self.Entity:SetSolid(SOLID_VPHYSICS)
  29.     local phys = self.Entity:GetPhysicsObject()
  30.  
  31.     if phys and phys:IsValid() then phys:Wake() end
  32. end
  33.  
  34. function ENT:Use()
  35.  
  36.     if not self.locked then
  37.         self.locked = true
  38.         self.sparking = true
  39.         timer.Create("spawntimer01", 0.1, 1, self.SpawnItem, self)
  40.     end
  41. end
  42.  
  43. function ENT:SpawnItem()
  44.     local pos = self:GetPos()
  45.     local weapon = ents.Create("weapon_rpg")
  46.     weapon:SetPos( pos + Vector(0,0,35))
  47.     weapon:Spawn()
  48.     weapon:Activate()
  49.     weapon:SetAngles(Angle(0,90,90))
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement