Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- SWEP.PrintName = "Vanity Gaming Flash SWEP"
- SWEP.Author = "[VG] Darragh"
- SWEP.Contact = "https://vanitygaming.enjin.com/"
- SWEP.Purpose = "Created for use in Vanity Gaming's DarkRP 54.36.229.1"
- SWEP.Category = "Vanity Gaming"
- SWEP.Instructions = "Run..."
- SWEP.Spawnable = true
- SWEP.UseHands = true
- SWEP.ViewModel = "models/weapons/c_arms_citizen.mdl"
- SWEP.WorldModel = ""
- SWEP.ViewModelFOV = 52
- SWEP.Primary.Delay = 0.5
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 2
- SWEP.SlotPos = 1
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = true
- function SWEP:Initialize()
- self:SetWeaponHoldType( "normal" )
- if !IsValid(self.Owner) then return end
- local vm = self.Owner:GetViewModel()
- if !IsValid(vm) then return end
- vm:ResetSequence( vm:LookupSequence( "reference" ) )
- end
- function SWEP:PrimaryAttack()
- local player = self.Owner
- if SERVER and not CLIENT then
- if(DarkRP != nil) then
- DarkRP.notify(player,0,4,"Flash Suit Equipped")
- else
- player:ChatPrint("Flash Suit Equipped")
- end
- end
- player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) * 2 )
- player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) * 9 )
- self:SetNextPrimaryFire(CurTime() + 3)
- end
- function SWEP:Deploy()
- local player = self.Owner
- if (!SERVER) then return end
- if (!IsValid( player )) then return end
- local vm = player:GetViewModel()
- if IsValid(vm) then
- vm:ResetSequence( vm:LookupSequence( "reference" ) )
- end
- if SERVER and not CLIENT then
- if(DarkRP != nil) then
- DarkRP.notify(player,0,4,"Flash Suit Equipped")
- else
- player:ChatPrint("Flash Suit Equipped")
- end
- end
- player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) * 2 )
- player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) * 9 )
- return true
- end
- function SWEP:Equip()
- local player = self.Owner
- if !IsValid( player ) then self:Remove() return end
- self.PlayerSpeedWalk = player:GetWalkSpeed() or GAMEMODE.Config.walkspeed or 160
- self.PlayerSpeedRun = player:GetRunSpeed() or GAMEMODE.Config.runspeed or 240
- end
- function SWEP:Holster()
- --Weapon is holstered.
- local player = self.Owner
- if IsValid( player ) then
- local vm = self.Owner:GetViewModel()
- if IsValid( vm ) then
- vm:SetMaterial( "" )
- end
- end
- player:SetWalkSpeed( (self.PlayerSpeedWalk or GAMEMODE.Config.walkspeed or 160) / 2 )
- player:SetRunSpeed( (self.PlayerSpeedRun or GAMEMODE.Config.walkspeed or 240) / 9 )
- if !SERVER then return end
- if SERVER and not CLIENT then
- if(DarkRP != nil) then
- DarkRP.notify(player,0,4,"Flash Suit Removed")
- else
- player:ChatPrint("Flash Suit Removed")
- end
- end
- return true
- end
- function SWEP:OnDrop()
- -- Function will run if the player is stripped of the SWEP, Dropped or player death.
- local player = self.Owner
- self:Remove()
- if player:IsValid() then
- player:StripWeapon( self:GetClass() )
- end
- end
- function SWEP:Think()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement