Advertisement
Guest User

glua_swep_muzzleflash

a guest
Aug 5th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. SWEP.PrintName    = "Test"
  2. SWEP.Author       = "Name"
  3.  
  4. SWEP.Spawnable    = true
  5. SWEP.UseHands     = true
  6. SWEP.ViewModelFOV = 55
  7. SWEP.ViewModel    = "models/weapons/c_smg1.mdl"
  8. SWEP.WorldModel   = "models/weapons/w_smg1.mdl"
  9.  
  10. SWEP.Primary.Automatic   = true
  11. SWEP.Primary.Ammo        = "none"
  12.  
  13. ------------------------------------------
  14.  
  15. function SWEP:PrimaryAttack()
  16.     if not IsFirstTimePredicted() then return end
  17.     local vm = self.Owner:GetViewModel()
  18.     local muzzle = vm:GetAttachment(1)
  19.     local position = muzzle.Pos
  20.  
  21.     local flash = EffectData()
  22.     flash:SetOrigin(position)
  23.     flash:SetEntity(self)
  24.     flash:SetAttachment(1)
  25.     flash:SetNormal(Vector())
  26.     flash:SetStart(position)
  27.     flash:SetScale(1)
  28.     util.Effect("CS_MuzzleFlash", flash)
  29. end
  30.  
  31. ------------------------------------------
  32.  
  33. -- Disable alt ammo hud and secondary fire
  34. SWEP.Secondary.Ammo = "none"
  35. SWEP.SecondaryAttack = function() end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement