-- ModuleScript WeaponFireLogic (via decompile) local ReplicatedStorage_1 = game:GetService("ReplicatedStorage") local Workspace_upv_1 = game:GetService("Workspace") local v1 = script:FindFirstAncestor("App") local WeaponRemotes_upv_1 = require(ReplicatedStorage_1.App.Remotes.WeaponRemotes) local GameSettings_upv_1 = require(v1.Modules.Menu.GameSettings) local RecoilController_upv_1 = require(v1.Modules.Weapon.RecoilController) local WeaponAimRay_upv_1 = require(v1.Modules.Weapon.WeaponAimRay) local WeaponReloadLogic_upv_1 = require(v1.Modules.Weapon.WeaponReloadLogic) local VfxRuntime_upv_1 = require(v1.Modules.Vfx.VfxRuntime) local ViewState_upv_1 = require(ReplicatedStorage_1.App.Modules.Character.ViewState) local WeaponHud_upv_1 = require(v1.Modules.Ui.WeaponHud) local WeaponRuntimeState_upv_1 = require(v1.Types.WeaponRuntimeState) local WeaponStateMachine_upv_1 = require(v1.Modules.Weapon.WeaponStateMachine) local u1 = Random.new() local tbl_1 = {} local function autoReload(a1) --[[ name: autoReload line: 27 ]] task.defer(function() end) end local function shielded(a1) --[[ name: shielded line: 66 ]] local Parent_1 = a1.head.Parent local v2 = (Parent_1 ~= nil) and (Parent_1:FindFirstChildOfClass("ForceField") ~= nil) return v2 end local function playFireAnimation(a1, a2) --[[ name: playFireAnimation line: 39 upvalues: u1 (copy, index: 1) ]] local v3 = nil if a2 then a1.animator.stop("Hit1", 0.05) a1.animator.stop("Hit2", 0.05) v3 = ((u1:NextInteger(1, 2) ~= 1) and "Hit2") or "Hit1" if a1.animator.has(v3) then a1.animator.restart(v3) return end end if a1.animator.has("Fire") then a1.animator.restart("Fire") elseif a2 then local u2 = Instance.new("StringValue") u2.Name = "toolanim" u2.Value = "Slash" u2.Parent = a1.tool task.delay( 0.1, function() --[[ line: 58 upvalues: u2 (copy, index: 1) ]] if not u2.Parent then return end u2:Destroy() end ) end end function tbl_1.fire(a1) --[[ name: fire line: 71 upvalues: WeaponStateMachine_upv_1 (copy, index: 1) ViewState_upv_1 (copy, index: 2) WeaponRemotes_upv_1 (copy, index: 5) WeaponAimRay_upv_1 (copy, index: 6) Workspace_upv_1 (copy, index: 7) WeaponHud_upv_1 (copy, index: 8) RecoilController_upv_1 (copy, index: 9) playFireAnimation (copy, index: 10) WeaponRuntimeState_upv_1 (copy, index: 11) VfxRuntime_upv_1 (copy, index: 12) ]] local config_1 = a1.config local v4 = config_1.category == "Melee" if not WeaponStateMachine_upv_1.canFire(a1.state, config_1.allowReloadInterrupt) then return end local Parent_2 = a1.head.Parent local v5 = (Parent_2 ~= nil) and (Parent_2:FindFirstChildOfClass("ForceField") ~= nil) if v5 then a1.trigger.abort() elseif not ViewState_upv_1.state.sprintBlocksFire then if not ViewState_upv_1.state.rolling and not (ViewState_upv_1.state.jumping) and not (ViewState_upv_1.state.airborne) then if not (v4) and a1.magazine <= 0 then a1.audio.dryFire() a1.trigger.abort() task.defer(function() end) return end if not (v4) and not (a1.aim.isRaised()) then a1.aim.snap() if not (config_1.allowHipFire) then return end end local v6 = os.clock() a1.consecutive = ((v6 - a1.lastShotAt > 0.4) and 1) or (a1.consecutive + 1) a1.lastShotAt = v6 a1.sequence = a1.sequence + 1 WeaponRemotes_upv_1.Fire:FireServer(a1.head.Position, WeaponAimRay_upv_1.direction(a1), a1.sequence, Workspace_upv_1:GetServerTimeNow()) if not (v4) then a1.magazine = a1.magazine - 1 WeaponHud_upv_1.setAmmo(a1.magazine, a1.reserve) RecoilController_upv_1.kick() a1.aim.noteShot() if a1.magazine <= 0 then task.defer(function() end) end end playFireAnimation(a1, v4) a1.audio.fire() WeaponRuntimeState_upv_1.transition(a1, "Firing") if v4 then return end local muzzleRig_1 = a1.muzzleRig if muzzleRig_1 then muzzleRig_1.flash(a1.consecutive) end local shell_1 = a1.shell local shellCasing_1 = config_1.shellCasing if shell_1 and shellCasing_1 then VfxRuntime_upv_1.shell(shellCasing_1, shell_1) end return end a1.trigger.abort() end end function tbl_1.autoReload(a1) --[[ name: autoReload line: 151 upvalues: GameSettings_upv_1 (copy, index: 1) WeaponReloadLogic_upv_1 (copy, index: 2) ]] task.defer( function() --[[ line: 28 upvalues: a1 (copy, index: 1) GameSettings_upv_1 (copy, index: 2) WeaponReloadLogic_upv_1 (copy, index: 3) ]] if not a1.alive or not GameSettings_upv_1.get("AutoReload") or (a1.magazine > 0) then return end WeaponReloadLogic_upv_1.request(a1) end ) end function tbl_1.sustainReset() --[[ name: sustainReset line: 155 ]] return 0.4 end tbl_1.bindCharacter = WeaponAimRay_upv_1.bindCharacter return tbl_1