Advertisement
Guest User

Untitled

a guest
May 30th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3. include('shared.lua')
  4.  
  5. function ENT:SpawnFunction(ply, tr)
  6.  
  7. if (!tr.Hit) or ply.Shield then return end
  8. local SpawnPos = tr.HitPos + tr.HitNormal
  9. local ent = ents.Create("halo_rocket")
  10. ent:SetPos(SpawnPos)
  11. ent:Spawn()
  12.  
  13. end
  14.  
  15. function ENT:Initialize()
  16. self:SetModel("models/weapons/w_missile_closed.mdl")
  17. if !self.Timer then
  18. self.Timer = CurTime() + 4
  19. end
  20. self:PhysicsInit(SOLID_VPHYSICS)
  21. self:SetMoveType(MOVETYPE_FLY)
  22. self:SetSolid(SOLID_VPHYSICS)
  23.  
  24. self:SetVelocity(self:GetForward() * 3500) //
  25.  
  26.  
  27. util.SpriteTrail(self.Entity, 0, Color(155, 155, 155, 155), false, 10, 10, 5, 5 / ((2 + 10) * 0.5), "trails/smoke.vmt")
  28.  
  29. /* self:SetGravity(.4)
  30. local phys = self:GetPhysicsObject()
  31.  
  32. if (phys:IsValid()) then
  33. phys:Wake()
  34. phys:SetMass(7)
  35. end */
  36. end
  37.  
  38. function ENT:Touch(ent)
  39. if self:GetOwner() != ent and (ent:IsPlayer() or ent:IsNPC() or ent:IsWorld() or ent:GetMoveType() == MOVETYPE_VPHYSICS) then
  40. self:Explosion() // Not the person who fired it? Kaboom.
  41. end
  42. end
  43.  
  44. function ENT:Explosion()
  45. if self:GetOwner() != nil then
  46. self.boom1 = self:GetOwner()
  47. else
  48. self.boom1 = self
  49. end
  50. self:EmitSound("ambient/explosions/explode_1.wav", 100, 100)
  51. local explo = ents.Create("env_explosion")
  52. explo:SetOwner(self.boom1)
  53. explo:SetPos(self.Entity:GetPos())
  54. explo:SetKeyValue("iMagnitude", "0")
  55. explo:Spawn()
  56. explo:Activate()
  57. explo:Fire("Explode", "", 0)
  58. local explo2 = ents.Create("env_physexplosion")
  59. explo2:SetOwner(self.boom1)
  60. explo2:SetPos(self.Entity:GetPos())
  61. explo2:SetKeyValue("magnitude", "100")
  62. explo2:SetKeyValue("radius", "240")
  63. explo2:SetKeyValue("spawnflags", "3")
  64. explo2:Spawn()
  65. explo2:Activate()
  66. explo2:Fire("Explode", "", 0)
  67. util.BlastDamage(self, self.boom1, self:GetPos(), 200, 150)
  68. self:Remove()
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement