Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. SWEP.PrintName = "Vanity Gaming Flash SWEP"
  4. SWEP.Author = "[VG] Darragh"
  5. SWEP.Contact = "https://vanitygaming.enjin.com/"
  6. SWEP.Purpose = "Created for use in Vanity Gaming's DarkRP 54.36.229.1"
  7. SWEP.Category = "Vanity Gaming"
  8. SWEP.Instructions = "Run..."
  9.  
  10. SWEP.Spawnable = true
  11. SWEP.UseHands = true
  12.  
  13. SWEP.ViewModel = "models/weapons/c_arms_citizen.mdl"
  14. SWEP.WorldModel = ""
  15.  
  16. SWEP.ViewModelFOV = 52
  17.  
  18. SWEP.Primary.Delay = 0.5
  19. SWEP.Primary.ClipSize = -1
  20. SWEP.Primary.DefaultClip = -1
  21. SWEP.Primary.Automatic = true
  22. SWEP.Primary.Ammo = "none"
  23.  
  24. SWEP.Secondary.ClipSize = -1
  25. SWEP.Secondary.DefaultClip = -1
  26. SWEP.Secondary.Automatic = false
  27. SWEP.Secondary.Ammo = "none"
  28.  
  29. SWEP.AutoSwitchTo = false
  30. SWEP.AutoSwitchFrom = false
  31.  
  32. SWEP.Slot = 2
  33. SWEP.SlotPos = 1
  34. SWEP.DrawAmmo = false
  35. SWEP.DrawCrosshair = true
  36.  
  37. function SWEP:Initialize()
  38. self:SetWeaponHoldType( "normal" )
  39. if !IsValid(self.Owner) then return end
  40. local vm = self.Owner:GetViewModel()
  41. if !IsValid(vm) then return end
  42. vm:ResetSequence( vm:LookupSequence( "reference" ) )
  43. end
  44.  
  45. function SWEP:PrimaryAttack()
  46. local player = self.Owner
  47.  
  48. if SERVER and not CLIENT then
  49. if(DarkRP != nil) then
  50. DarkRP.notify(player,0,4,"Flash Suit Equipped")
  51. else
  52. player:ChatPrint("Flash Suit Equipped")
  53. end
  54. end
  55. player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) * 2 )
  56. player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) * 9 )
  57.  
  58. self:SetNextPrimaryFire(CurTime() + 3)
  59. end
  60.  
  61. function SWEP:Deploy()
  62.  
  63. local player = self.Owner
  64. if (!SERVER) then return end
  65. if (!IsValid( player )) then return end
  66. local vm = player:GetViewModel()
  67. if IsValid(vm) then
  68. vm:ResetSequence( vm:LookupSequence( "reference" ) )
  69. end
  70.  
  71. if SERVER and not CLIENT then
  72. if(DarkRP != nil) then
  73. DarkRP.notify(player,0,4,"Flash Suit Equipped")
  74. else
  75. player:ChatPrint("Flash Suit Equipped")
  76. end
  77. end
  78.  
  79. player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) * 2 )
  80. player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) * 9 )
  81.  
  82. return true
  83. end
  84.  
  85. function SWEP:Equip()
  86. local player = self.Owner
  87. if !IsValid( player ) then self:Remove() return end
  88. self.PlayerSpeedWalk = player:GetWalkSpeed() or GAMEMODE.Config.walkspeed or 160
  89. self.PlayerSpeedRun = player:GetRunSpeed() or GAMEMODE.Config.runspeed or 240
  90. end
  91.  
  92. function SWEP:Holster()
  93. --Weapon is holstered.
  94. local player = self.Owner
  95. if IsValid( player ) then
  96. local vm = self.Owner:GetViewModel()
  97. if IsValid( vm ) then
  98. vm:SetMaterial( "" )
  99. end
  100. end
  101. player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) / 2 )
  102. player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) / 9 )
  103.  
  104. if !SERVER then return end
  105.  
  106. if SERVER and not CLIENT then
  107. if(DarkRP != nil) then
  108. DarkRP.notify(player,0,4,"Flash Suit Removed")
  109. else
  110. player:ChatPrint("Flash Suit Removed")
  111. end
  112. end
  113.  
  114. return true
  115. end
  116.  
  117. function SWEP:OnDrop()
  118. -- Function will run if the player is stripped of the SWEP, Dropped or player death.
  119. local player = self.Owner
  120.  
  121. self:Remove()
  122. if player:IsValid() then
  123. player:StripWeapon( self:GetClass() )
  124. end
  125. end
  126.  
  127. function SWEP:Think()
  128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement