-- ModuleScript WeaponController (via decompile) local Players_1 = game:GetService("Players") local ReplicatedStorage_1 = game:GetService("ReplicatedStorage") local RunService_upv_1 = game:GetService("RunService") local v1 = script:FindFirstAncestor("App") local _ = require(v1.Types.AppTypes) local CharacterPose_upv_1 = require(ReplicatedStorage_1.App.Modules.Character.CharacterPose) local WeaponRemotes_upv_1 = require(ReplicatedStorage_1.App.Remotes.WeaponRemotes) local RecoilController_upv_1 = require(v1.Modules.Weapon.RecoilController) local ViewState_upv_1 = require(ReplicatedStorage_1.App.Modules.Character.ViewState) local WeaponEffectReceiver_upv_1 = require(v1.Modules.Vfx.WeaponEffectReceiver) local WeaponInput_upv_1 = require(v1.Modules.Weapon.WeaponInput) local WeaponLocomotion_upv_1 = require(v1.Modules.Weapon.WeaponLocomotion) local WeaponPreload_upv_1 = require(v1.Modules.Weapon.WeaponPreload) local WeaponRegistry_upv_1 = require(ReplicatedStorage_1.App.Config.WeaponRegistry) local WeaponRuntime_upv_1 = require(v1.Modules.Weapon.WeaponRuntime) local u1 = Enum.RenderPriority.Camera.Value - 10 local LocalPlayer_upv_1 = Players_1.LocalPlayer local u2 = nil local u3 = nil local u4 = nil local tbl_upv_1 = {} local u5 = 0 local u6 = 0 local u7 = false local u8 = 0 local tbl_2 = {name = "WeaponController"} local function teardownWeapon() --[[ name: teardownWeapon line: 42 upvalues: u2 (ref, index: 1) WeaponInput_upv_1 (copy, index: 2) ]] if not u2 then return end u2 = nil WeaponInput_upv_1.unbind() u2.destroy() end local function onToolEquipped(a1) --[[ name: onToolEquipped line: 52 upvalues: u3 (ref, index: 1) u4 (ref, index: 2) ViewState_upv_1 (copy, index: 3) WeaponRegistry_upv_1 (copy, index: 4) u2 (ref, index: 5) WeaponInput_upv_1 (copy, index: 6) u6 (ref, index: 7) u5 (ref, index: 8) LocalPlayer_upv_1 (copy, index: 9) WeaponRuntime_upv_1 (copy, index: 10) ]] if not u3 or not u4 or (u4.Health <= 0) then return end if not (ViewState_upv_1.state.inVehicle) and not (ViewState_upv_1.state.enteringVehicle) and not (u4.Sit) and u4.SeatPart == nil then local u9 = WeaponRegistry_upv_1.forTool(a1) if not u9 then return end if u2 then u2 = nil WeaponInput_upv_1.unbind() u2.destroy() end u6 = u6 + 1 local u10 = u6 local u11 = u5 task.spawn( function() --[[ line: 80 upvalues: a1 (copy, index: 1) u9 (copy, index: 2) u10 (copy, index: 3) u6 (ref, index: 4) u11 (copy, index: 5) u5 (ref, index: 6) LocalPlayer_upv_1 (copy, index: 7) u3 (copy, index: 8) u4 (copy, index: 9) WeaponRuntime_upv_1 (copy, index: 10) u2 (ref, index: 11) WeaponInput_upv_1 (copy, index: 12) ]] local v2 = a1:WaitForChild("Handle", 6) local v3 = nil if v2 then v3 = u9.muzzleAttachment if v3 then v2:WaitForChild(v3, 2) end local shellAttachment_1 = u9.shellAttachment if shellAttachment_1 then v2:WaitForChild(shellAttachment_1, 2) end end if u10 ~= u6 or u11 ~= u5 then return end if LocalPlayer_upv_1.Character == u3 and a1.Parent == u3 then if not (u4.Health <= 0) and u4.Parent then if v2 then local v4 = WeaponRuntime_upv_1.create(u3, u4, a1, u9) if not v4 then return end u2 = v4 local tbl_3 = {} function tbl_3.fireBegan() --[[ name: fireBegan line: 115 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.fireInput(true) end function tbl_3.fireEnded() --[[ name: fireEnded line: 121 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.fireInput(false) end function tbl_3.aimBegan() --[[ name: aimBegan line: 127 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.aimInput(true) end function tbl_3.aimEnded() --[[ name: aimEnded line: 133 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.aimInput(false) end function tbl_3.reload() --[[ name: reload line: 139 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.reloadInput() end WeaponInput_upv_1.bind(tbl_3) else warn((("WeaponController: %* never replicated a Handle; re-equip to retry"):format(u9.id))) end return end return end end ) return end if ViewState_upv_1.state.enteringVehicle and not (u4.Sit) and u4.SeatPart == nil then task.defer( function() --[[ line: 60 upvalues: a1 (copy, index: 1) u3 (copy, index: 2) u4 (copy, index: 3) ]] if a1.Parent ~= u3 or not u4.Parent or (u4.SeatPart) then return end u4:UnequipTools() end ) end end local function onCharacterAdded(a1) --[[ name: onCharacterAdded line: 149 upvalues: u5 (ref, index: 1) u2 (ref, index: 2) WeaponInput_upv_1 (copy, index: 3) tbl_upv_1 (copy, index: 4) LocalPlayer_upv_1 (copy, index: 5) u3 (ref, index: 6) u4 (ref, index: 7) CharacterPose_upv_1 (copy, index: 8) WeaponLocomotion_upv_1 (copy, index: 9) ViewState_upv_1 (copy, index: 10) onToolEquipped (copy, index: 11) teardownWeapon (copy, index: 12) ]] u5 = u5 + 1 if u2 then u2 = nil WeaponInput_upv_1.unbind() u2.destroy() end for _, value_1 in ipairs(tbl_upv_1) do value_1:Disconnect() end table.clear(tbl_upv_1) local v5 = a1:WaitForChild("Humanoid", 10) if u5 ~= u5 or LocalPlayer_upv_1.Character ~= a1 then return end if v5 and v5:IsA("Humanoid") then u3 = a1 u4 = v5 CharacterPose_upv_1.bind(a1) WeaponLocomotion_upv_1.bind(a1, v5) ViewState_upv_1.resetWeapon() table.insert( tbl_upv_1, a1.ChildAdded:Connect( function(a2) --[[ line: 174 upvalues: onToolEquipped (copy, index: 1) ]] if not a2:IsA("Tool") then return end onToolEquipped(a2) end ) ) table.insert( tbl_upv_1, a1.ChildRemoved:Connect( function(a3) --[[ line: 179 upvalues: u2 (ref, index: 1) WeaponInput_upv_1 (copy, index: 2) ]] if not a3:IsA("Tool") or not u2 or not u2 then return end u2 = nil WeaponInput_upv_1.unbind() u2.destroy() end ) ) table.insert(tbl_upv_1, v5.Died:Connect(teardownWeapon)) for _, value_2 in ipairs(a1:GetChildren()) do if value_2:IsA("Tool") then onToolEquipped(value_2) end end else warn("WeaponController: character has no Humanoid") end end local function onCharacterRemoving() --[[ name: onCharacterRemoving line: 193 upvalues: u5 (ref, index: 1) u2 (ref, index: 2) WeaponInput_upv_1 (copy, index: 3) tbl_upv_1 (copy, index: 4) CharacterPose_upv_1 (copy, index: 5) WeaponLocomotion_upv_1 (copy, index: 6) ViewState_upv_1 (copy, index: 7) u3 (ref, index: 8) u4 (ref, index: 9) ]] u5 = u5 + 1 if u2 then u2 = nil WeaponInput_upv_1.unbind() u2.destroy() end for _, value_3 in ipairs(tbl_upv_1) do value_3:Disconnect() end table.clear(tbl_upv_1) CharacterPose_upv_1.unbind() WeaponLocomotion_upv_1.release() ViewState_upv_1.resetWeapon() u3 = nil u4 = nil end local function healUnboundCharacter() --[[ name: healUnboundCharacter line: 207 upvalues: u7 (ref, index: 1) u8 (ref, index: 2) LocalPlayer_upv_1 (copy, index: 3) u3 (ref, index: 4) u4 (ref, index: 5) CharacterPose_upv_1 (copy, index: 6) onCharacterAdded (copy, index: 7) ]] local v6 = os.clock() if (u7) then return end if not (v6 - u8 < 1) then local Character_upv_1 = LocalPlayer_upv_1.Character if Character_upv_1 and Character_upv_1.Parent then local v7 = Character_upv_1:FindFirstChildOfClass("Humanoid") if v7 and not (v7.Health <= 0) then if u3 == Character_upv_1 and u4 == v7 and CharacterPose_upv_1.isBound() then return end u8 = v6 u7 = true task.spawn( function() --[[ line: 225 upvalues: onCharacterAdded (copy, index: 1) Character_upv_1 (copy, index: 2) u7 (ref, index: 3) ]] local success_1, v8 = pcall(onCharacterAdded, Character_upv_1) u7 = false if (success_1) then return end warn((("[WeaponController] could not bind the live character: %*"):format(v8))) end ) return end return end end end local function update(a1) --[[ name: update line: 234 upvalues: healUnboundCharacter (copy, index: 1) RecoilController_upv_1 (copy, index: 2) u2 (ref, index: 3) WeaponInput_upv_1 (copy, index: 4) WeaponLocomotion_upv_1 (copy, index: 5) ]] healUnboundCharacter() RecoilController_upv_1.update(a1) if u2 then u2.update(a1) local v9, v10, v11 = u2.availability() WeaponInput_upv_1.setCapabilities(v9, v10, v11) end WeaponLocomotion_upv_1.update(a1) end function tbl_2.init() --[[ name: init line: 248 upvalues: WeaponRemotes_upv_1 (copy, index: 1) u2 (ref, index: 2) WeaponEffectReceiver_upv_1 (copy, index: 3) ]] WeaponRemotes_upv_1.Ammo.OnClientEvent:Connect( function(a1, a2, a3) --[[ line: 249 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.onAmmo(a1, a2, a3) end ) WeaponRemotes_upv_1.ReloadStart.OnClientEvent:Connect( function(a4, a5, a6) --[[ line: 256 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.onReloadStart(a4, a5, a6) end ) WeaponRemotes_upv_1.Reject.OnClientEvent:Connect( function(a7) --[[ line: 263 upvalues: u2 (ref, index: 1) ]] if not u2 then return end u2.onReject(a7) end ) WeaponRemotes_upv_1.Shot.OnClientEvent:Connect(WeaponEffectReceiver_upv_1.receive) end function tbl_2.start() --[[ name: start line: 273 upvalues: WeaponPreload_upv_1 (copy, index: 1) LocalPlayer_upv_1 (copy, index: 2) onCharacterAdded (copy, index: 3) onCharacterRemoving (copy, index: 4) RunService_upv_1 (copy, index: 5) u1 (copy, index: 6) update (copy, index: 7) ]] WeaponPreload_upv_1.start() LocalPlayer_upv_1.CharacterAdded:Connect( function(a1) --[[ line: 275 upvalues: onCharacterAdded (copy, index: 1) ]] task.spawn(onCharacterAdded, a1) end ) LocalPlayer_upv_1.CharacterRemoving:Connect(onCharacterRemoving) RunService_upv_1:BindToRenderStep("WeaponFrameworkClient", u1, update) if not LocalPlayer_upv_1.Character then return end task.spawn(onCharacterAdded, LocalPlayer_upv_1.Character) end return tbl_2