Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if SERVER then
  2.     AddCSLuaFile( "shared.lua" )
  3.     resource.AddWorkshop("")
  4.  end
  5.  
  6. SWEP.HoldType              = "pistol"
  7.  
  8. if CLIENT then
  9.    SWEP.PrintName          = "MemeGun"
  10.    SWEP.Slot               = 6
  11.  
  12.    SWEP.ViewModelFlip      = false
  13.    SWEP.ViewModelFOV       = 54
  14.    
  15.    SWEP.EquipMenuData = {
  16.       type = "item_weapon",
  17.       desc = "1 Shot.\n\nCauses victim to dance uncontrollably, and sing a meme, \nthen die 14 seconds later."
  18.    };
  19.  
  20.    SWEP.Icon = "vgui/ttt/alexjones.png"
  21. end
  22.  
  23. SWEP.Base                  = "weapon_tttbase"
  24.  
  25. SWEP.Kind                  = WEAPON_PISTOL
  26. SWEP.WeaponID              = AMMO_PISTOL
  27.  
  28. SWEP.Primary.Recoil        = 3
  29. SWEP.Primary.Damage        = 1
  30. SWEP.Primary.Delay         = 1
  31. SWEP.Primary.Cone          = 0.01
  32. SWEP.Primary.ClipSize      = 1
  33. SWEP.Primary.Automatic     = false
  34. SWEP.Primary.DefaultClip   = 1
  35. SWEP.Primary.ClipMax       = 1
  36. SWEP.Primary.Ammo          = "none"
  37. SWEP.AmmoEnt               = "none"
  38.  
  39. SWEP.UseHands              = true
  40. SWEP.ViewModel             = "models/weapons/cstrike/c_pist_fiveseven.mdl"
  41. SWEP.WorldModel            = "models/weapons/w_pist_fiveseven.mdl"
  42.  
  43. SWEP.Kind = WEAPON_EQUIP1
  44. SWEP.CanBuy = {ROLE_TRAITOR}
  45. SWEP.LimitedStock = true
  46.  
  47. SWEP.IronSightsPos         = Vector(-5.95, -1, 4.799)
  48. SWEP.IronSightsAng         = Vector(0, 0, 0)
  49.  
  50. function SWEP:PrimaryAttack()
  51.    if not self:CanPrimaryAttack() then return end
  52.    self.Owner:EmitSound("boom.wav")
  53.    local cone = self.Primary.Cone
  54.    local num = 1
  55.  
  56.    local bullet = {}
  57.    bullet.Num    = num
  58.    bullet.Src    = self.Owner:GetShootPos()
  59.    bullet.Dir    = self.Owner:GetAimVector()
  60.    bullet.Spread = Vector( cone, cone, 0 )
  61.    bullet.Tracer = 1
  62.    bullet.Force = 10
  63.    bullet.Damage = 1
  64.    bullet.TracerName = "PhyscannonImpact"
  65.    
  66.    bullet.Callback = function(att, tr)
  67.                         if SERVER or (CLIENT and IsFirstTimePredicted()) then
  68.                             local ent = tr.Entity
  69.                             local songList = math.random(1,6)
  70.                               if SERVER and ent:IsPlayer() then
  71.                                 if songList == 1 then
  72.                                     ent:EmitSound("oceanman.wav")
  73.                                     ent:GodEnable()
  74.                                   elseif songList == 2 then
  75.                                     ent:EmitSound("sippinyak.wav")
  76.                                     ent:GodEnable()
  77.                                   elseif songList == 3 then
  78.                                     ent:EmitSound("tombstone.wav")
  79.                                     ent:GodEnable()
  80.                                   elseif songList == 4 then
  81.                                     ent:EmitSound("mario.wav")
  82.                                     ent:GodEnable()
  83.                                   elseif songList == 5 then
  84.                                     ent:EmitSound("kicks.wav")
  85.                                     ent:GodEnable()
  86.                                   elseif songList == 6 then
  87.                                   end
  88.                                     ent:EmitSound("girl.wav")
  89.                                     ent:GodEnable()
  90.                                 local timerName = "reDance" .. math.random(1,10000)
  91.                                 timer.Create( timerName, 1, 14, function()
  92.                                   local danceChange = math.random(1, 2)
  93.                                   if danceChange == 1 then
  94.                                     ent:DoAnimationEvent( ACT_GMOD_GESTURE_TAUNT_ZOMBIE, 1641 )
  95.                                   else
  96.                                     ent:DoAnimationEvent( ACT_GMOD_TAUNT_DANCE, 1642 )
  97.                                   end
  98.                                   if !ent:IsFrozen() then ent:Freeze(true) end
  99.                                 end)
  100.                                 ent:Freeze(true)
  101.                                 timer.Simple( 14, function()
  102.                                     if ent:Alive() then
  103.                                     ent:GodDisable()
  104.                                     ent:Freeze(false)
  105.                                     local totalHealth = ent:Health()
  106.                                     local inflictWep = ents.Create('weapon_ttt_thriller')
  107.                                     ent:TakeDamage( totalHealth, att, inflictWep )
  108.                                     timer.Simple( 2, function() if ent:IsFrozen() then ent:Freeze(false) end end)
  109.                                     end
  110.                                 end)
  111.                                  
  112.                               end
  113.                            end
  114.                         end
  115.    self.Owner:FireBullets( bullet )
  116.    if SERVER then
  117.      self:TakePrimaryAmmo( 1 )
  118.    end
  119. end
  120.  
  121. function SWEP:OnDrop()
  122.     self:Remove()
  123. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement