Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RS = cloneref(game:GetService("ReplicatedStorage"))
- local GameReq = getrenv().require
- local RunService = cloneref(game:GetService("RunService"))
- local UIS = cloneref(game:GetService("UserInputService"))
- local WC = GameReq(RS.common.ZS_Framework.Modules.Controllers.WeaponController)
- local AS = GameReq(RS.common.ZS_Framework.Modules.Controllers.WeaponController.WeaponControllerUtils.AutoShoot)
- local Players = game:GetService("Players")
- local Player = game:GetService("Players").LocalPlayer
- local ZombiesFolder = workspace:FindFirstChild("Zombies")
- if #Players:GetPlayers() ~= 1 then return end
- local IsMouseButtonPressed = UIS.IsMouseButtonPressed
- local GetCurrentWeapon = WC.GetCurrentWeapon
- local MB1 = Enum.UserInputType.MouseButton1
- local Heartbeat = RunService.Heartbeat
- local os_clock = os.clock
- local MyPenetration = 1
- local Timeout = 0
- local WaitStart = 0
- WC:SetInputMethod("Keyboard")
- local function GetZombieCount()
- if not ZombiesFolder or not ZombiesFolder.Parent then
- ZombiesFolder = workspace:FindFirstChild("Zombies")
- end
- if not ZombiesFolder then return 0 end
- local c = 0
- local children = ZombiesFolder:GetChildren()
- for i = 1, #children do
- local z = children[i]
- local hp = z:GetAttribute("Health")
- if not hp or hp > 0 then
- c = c + 1
- end
- end
- return c
- end
- AS.CheckTarget = function()
- return GetZombieCount() > 0
- end
- Heartbeat:Connect(function()
- local weapon = GetCurrentWeapon(WC)
- if weapon and weapon.Config and not weapon.Config.IsMelee then
- local count = GetZombieCount()
- local fireNow = false
- if count >= MyPenetration then
- fireNow = true
- WaitStart = 0
- elseif count > 0 then
- if WaitStart == 0 then
- WaitStart = os_clock()
- end
- if os_clock() - WaitStart >= Timeout then
- fireNow = true
- end
- else
- WaitStart = 0
- end
- if weapon.Ammo > 0 and not weapon.Reloading and fireNow then
- WC.PrimaryAttackDown = true
- weapon.MouseReleased = true
- if count >= MyPenetration or os_clock() - WaitStart >= Timeout then
- WaitStart = 0
- end
- elseif not IsMouseButtonPressed(UIS, MB1) then
- WC.PrimaryAttackDown = false
- end
- else
- WaitStart = 0
- if not IsMouseButtonPressed(UIS, MB1) then
- WC.PrimaryAttackDown = false
- end
- end
- end)
- warn("AUTO SHOOT LOADED SUCCESFULLY")
Advertisement
Add Comment
Please, Sign In to add comment