Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local isBurstFireRunning = false
- local HandlePistolBurstFiring = function(player,weapon,path)
- RunAsync(function()
- if isBurstFireRunning then return end
- isBurstFireRunning = true
- Wait(CustomEvent("OnStep"))
- local burstFiring = false
- RunHandled(function()
- while not IsDeleted(weapon) do
- Wait(CustomEvent("OnStep"))
- end
- isBurstFireRunning = false
- end,
- OnEvery(CustomEvent(weapon,"Fired")),
- function()
- if (worldGlobals.AltFireCurrentFiringModes[weapon] == 2) and not burstFiring then
- burstFiring = true
- local ammoInClip = weapon:GetAmmoInClip()
- player:FireButtonPressed(0)
- while not IsDeleted(weapon) and not IsDeleted(player) and (ammoInClip - weapon:GetAmmoInClip() < 2) and burstFiring do
- if (ammoInClip - weapon:GetAmmoInClip() == 1) then weapon:SetRateOfFireMultiplier(0.6) end
- player:FireButtonPressed(0)
- Wait(CustomEvent("OnStep"))
- end
- player:FireButtonReleased(0)
- if not burstFiring then return end
- weapon:SetRateOfFireMultiplier(2)
- Wait(CustomEvent("OnStep"))
- burstFiring = false
- end
- end,
- OnEvery(CustomEvent(weapon,"Reloaded")),
- function()
- burstFiring = false
- if (worldGlobals.AltFireCurrentFiringModes[weapon] == 2) then
- weapon:SetRateOfFireMultiplier(2)
- end
- end
- )
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement