CapsAdmin

Untitled

Nov 1st, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. easylua.StartWeapon("mortarbanni")
  2.  
  3. SWEP.Base = "weapon_sh_scout"
  4. SWEP.ViewModel = "models/weapons/v_rpg.mdl"
  5. SWEP.ViewModelFlip = false
  6. SWEP.Primary.Sound = "/weapons/flare_detonator_explode.wav"
  7.  
  8. function SWEP:CSShootBullet()
  9.  
  10.         if SERVER then
  11.             local ent = ents.Create("sent_rocket")
  12.            
  13.             ent:SetPos(self.Owner:EyePos() + self.Owner:GetUp() * 5)
  14.             ent:SetOwner(self.Owner)
  15.             ent:SetAngles(self.Owner:EyeAngles())
  16.             ent.RocketOwner = self.Owner
  17.             ent:Spawn()
  18.  
  19.             local phys = ent:GetPhysicsObject()
  20.             phys:ApplyForceCenter(self.Owner:GetAimVector() * 100)
  21.            
  22.             timer.Simple(0.8, function()
  23.                 if phys:IsValid() then
  24.                     phys:AddVelocity(self.Owner:GetAimVector() * 10000000000000 + Vector(0,0,200))
  25.                 end
  26.             end)
  27.            
  28.         end
  29.        
  30.         if self.Owner:IsNPC() then return end
  31.        
  32.         self.Owner:RemoveAmmo(0, self.Primary.Ammo)
  33.  
  34.         self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)        // View model animation
  35.         self.Owner:MuzzleFlash()                                // Crappy muzzle light
  36.         self.Owner:SetAnimation(PLAYER_ATTACK1)             // 3rd Person Animation
  37.        
  38. end
  39.  
  40. easylua.EndWeapon()
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment