-- ModuleScript WeaponInventoryController (via decompile) local WeaponSlotResolver_upv_1 = require(game:GetService("ReplicatedStorage").Modules.WeaponSlotResolver) local tbl_upv_1 = {} local function disconnectConnections(a1) --[[ name: disconnectConnections line: 8 ]] for _, value_1 in ipairs(a1) do value_1:Disconnect() end table.clear(a1) end function tbl_upv_1.GetAuthoritativeTools(a1) --[[ name: GetAuthoritativeTools line: 33 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] return WeaponSlotResolver_upv_1.CollectAuthoritativeTools(a1) end local function bindContainer(a1, a2, a3) --[[ name: bindContainer line: 15 ]] if not a2 then return end table.insert( a1, a2.ChildAdded:Connect( function(a4) --[[ line: 20 upvalues: a3 (copy, index: 1) ]] if not a4:IsA("Tool") then return end a3() end ) ) table.insert( a1, a2.ChildRemoved:Connect( function(a5) --[[ line: 26 upvalues: a3 (copy, index: 1) ]] if not a5:IsA("Tool") then return end a3() end ) ) end function tbl_upv_1.WatchPlayerInventory(a1, a2) --[[ name: WatchPlayerInventory line: 37 upvalues: tbl_upv_1 (copy, index: 1) bindContainer (copy, index: 2) ]] local tbl_upv_2 = {} local tbl_upv_3 = {} local tbl_upv_4 = {} local u1 = false local function emitCurrentInventory() --[[ name: emitCurrentInventory line: 43 upvalues: a2 (copy, index: 1) tbl_upv_1 (copy, index: 2) a1 (copy, index: 3) ]] a2(tbl_upv_1.GetAuthoritativeTools(a1)) end local function scheduleEmitCurrentInventory() --[[ name: scheduleEmitCurrentInventory line: 47 upvalues: u1 (ref, index: 1) ]] if u1 == true then return end u1 = true task.defer(function() end) end local function bindCharacter(a3) --[[ name: bindCharacter line: 59 upvalues: tbl_upv_3 (copy, index: 1) bindContainer (copy, index: 2) scheduleEmitCurrentInventory (copy, index: 3) ]] for _, value_2 in ipairs(tbl_upv_3) do value_2:Disconnect() end table.clear(tbl_upv_3) bindContainer(tbl_upv_3, a3, scheduleEmitCurrentInventory) end local function bindBackpack(a4) --[[ name: bindBackpack line: 64 upvalues: tbl_upv_4 (copy, index: 1) bindContainer (copy, index: 2) scheduleEmitCurrentInventory (copy, index: 3) ]] for _, value_3 in ipairs(tbl_upv_4) do value_3:Disconnect() end table.clear(tbl_upv_4) bindContainer(tbl_upv_4, a4, scheduleEmitCurrentInventory) end local v1 = a1:FindFirstChildOfClass("Backpack") for _, value_4 in ipairs(tbl_upv_4) do value_4:Disconnect() end table.clear(tbl_upv_4) bindContainer(tbl_upv_4, v1, scheduleEmitCurrentInventory) local Character_1 = a1.Character for _, value_5 in ipairs(tbl_upv_3) do value_5:Disconnect() end table.clear(tbl_upv_3) bindContainer(tbl_upv_3, Character_1, scheduleEmitCurrentInventory) table.insert( tbl_upv_2, a1.CharacterAdded:Connect( function(a5) --[[ line: 72 upvalues: tbl_upv_3 (copy, index: 1) bindContainer (copy, index: 2) scheduleEmitCurrentInventory (copy, index: 3) u1 (ref, index: 4) ]] for _, value_6 in ipairs(tbl_upv_3) do value_6:Disconnect() end table.clear(tbl_upv_3) bindContainer(tbl_upv_3, a5, scheduleEmitCurrentInventory) if u1 == true then return end u1 = true task.defer(function() end) end ) ) table.insert( tbl_upv_2, a1.ChildAdded:Connect( function(a6) --[[ line: 77 upvalues: tbl_upv_4 (copy, index: 1) bindContainer (copy, index: 2) scheduleEmitCurrentInventory (copy, index: 3) u1 (ref, index: 4) a2 (copy, index: 5) tbl_upv_1 (copy, index: 6) a1 (copy, index: 7) ]] if not a6:IsA("Backpack") then return end for _, value_7 in ipairs(tbl_upv_4) do value_7:Disconnect() end table.clear(tbl_upv_4) bindContainer(tbl_upv_4, a6, scheduleEmitCurrentInventory) if u1 == true then return end u1 = true task.defer( function() --[[ line: 53 upvalues: u1 (ref, index: 1) a2 (copy, index: 2) tbl_upv_1 (copy, index: 3) a1 (copy, index: 4) ]] u1 = false a2(tbl_upv_1.GetAuthoritativeTools(a1)) end ) end ) ) a2(tbl_upv_1.GetAuthoritativeTools(a1)) return function() --[[ line: 86 upvalues: tbl_upv_3 (copy, index: 1) tbl_upv_4 (copy, index: 2) tbl_upv_2 (copy, index: 3) ]] for _, value_8 in ipairs(tbl_upv_3) do value_8:Disconnect() end table.clear(tbl_upv_3) for _, value_9 in ipairs(tbl_upv_4) do value_9:Disconnect() end table.clear(tbl_upv_4) for _, value_10 in ipairs(tbl_upv_2) do value_10:Disconnect() end table.clear(tbl_upv_2) end end return tbl_upv_1