-- ModuleScript WeaponSlotResolver (via decompile) local ReplicatedStorage_1 = game:GetService("ReplicatedStorage") local Config_upv_1 = require(ReplicatedStorage_1:WaitForChild("Config")) local _ = require(ReplicatedStorage_1.Modules.TypeModules.Types) local tbl_upv_1 = {} local tbl_upv_2 = {"Primary", "Secondary", "Knife", "Throwable"} local tbl_upv_3 = {Knife = 3, Primary = 1, Throwable = 4, Secondary = 2} local tbl_upv_4 = { VaultActive = false, CrosshairStyle = "Dot", ThrowablePreviewActive = false, Reloading = false, WeaponFullyReady = false, WeaponReady = false, CrosshairSizeY = 3, CurrentActionState = "Hold", EquippedToolName = "", SwapInProgress = false, Inspecting = false, Aiming = false, EquippedSlot = "", InitialEquipReady = false, EquippedToolSerial = "", WeaponPresentationReady = false, CrosshairFollowMouse = false, ThrowablePreviewToolName = "", PendingRequestId = "", CrosshairMinSpread = 0, CrosshairSizeX = 3, Holstered = true } local function isWeaponTool(a1) --[[ name: isWeaponTool line: 48 ]] local v1 = (a1 ~= nil) and (a1:IsA("Tool") and (typeof(a1:GetAttribute("Class")) == "string")) return v1 end local function isAuthoritativeParent(a1) --[[ name: isAuthoritativeParent line: 52 ]] if not a1 then return false end local v2 = a1:IsA("Backpack") or (a1:IsA("Model")) return v2 end function tbl_upv_1.GetSupportedSlots() --[[ name: GetSupportedSlots line: 60 upvalues: tbl_upv_2 (copy, index: 1) ]] return table.clone(tbl_upv_2) end function tbl_upv_1.GetClassFromIndex(a1) --[[ name: GetClassFromIndex line: 64 upvalues: tbl_upv_2 (copy, index: 1) ]] return tbl_upv_2[a1] end function tbl_upv_1.GetIndexFromClass(a1) --[[ name: GetIndexFromClass line: 68 upvalues: tbl_upv_3 (copy, index: 1) ]] if a1 then return tbl_upv_3[a1] end return nil end function tbl_upv_1.IsSupportedSlot(a1) --[[ name: IsSupportedSlot line: 76 upvalues: tbl_upv_1 (copy, index: 1) ]] local v3 = tbl_upv_1.GetIndexFromClass(a1) ~= nil return v3 end function tbl_upv_1.GetToolClass(a1) --[[ name: GetToolClass line: 80 upvalues: tbl_upv_1 (copy, index: 1) ]] if not a1 then return nil end local v4 = a1:GetAttribute("Class") if typeof(v4) == "string" and tbl_upv_1.IsSupportedSlot(v4) == true then return v4 end return nil end function tbl_upv_1.GetToolSerial(a1) --[[ name: GetToolSerial line: 97 ]] if not a1 then return nil end local v5 = a1:GetAttribute("ToolSerial") if typeof(v5) == "string" and v5 ~= "" then return v5 end return nil end function tbl_upv_1.GetOrAssignToolSerial(a1) --[[ name: GetOrAssignToolSerial line: 110 upvalues: tbl_upv_1 (copy, index: 1) Config_upv_1 (copy, index: 2) ]] local v6 = tbl_upv_1.GetToolSerial(a1) if v6 then return v6 end local v7 = Config_upv_1.CreateRandomSerialID() a1:SetAttribute("ToolSerial", v7) return v7 end function tbl_upv_1.ResolveClientWeaponSystem(a1) --[[ name: ResolveClientWeaponSystem line: 121 ]] if not a1 then return nil end local ClientWeaponSystem_1 = a1:FindFirstChild("ClientWeaponSystem") if ClientWeaponSystem_1 and ClientWeaponSystem_1:IsA("LocalScript") then return ClientWeaponSystem_1 end return nil end function tbl_upv_1.EnsureRuntimeFolders(a1) --[[ name: EnsureRuntimeFolders line: 134 upvalues: tbl_upv_1 (copy, index: 1) tbl_upv_4 (copy, index: 2) ]] local v8 = tbl_upv_1.ResolveClientWeaponSystem(a1) if not v8 then return nil, nil, nil end local v9 = v8:FindFirstChild("State") if not (v9) then local v10 = Instance.new("Folder") v10.Name = "State" v10.Parent = v8 v9 = v10 end local v11 = v8:FindFirstChild("ServerModels") if not (v11) then local v12 = Instance.new("Folder") v12.Name = "ServerModels" v12.Parent = v8 v11 = v12 end for key_1, value_1 in pairs(tbl_upv_4) do if v9:GetAttribute(key_1) == nil then v9:SetAttribute(key_1, value_1) end end return v8, v9, v11 end function tbl_upv_1.GetStateFolder(a1) --[[ name: GetStateFolder line: 163 upvalues: tbl_upv_1 (copy, index: 1) ]] local v13 = tbl_upv_1.ResolveClientWeaponSystem(a1) if not v13 then return nil end local State_1 = v13:FindFirstChild("State") if State_1 and State_1:IsA("Folder") then return State_1 end return nil end function tbl_upv_1.GetServerModelsFolder(a1) --[[ name: GetServerModelsFolder line: 177 upvalues: tbl_upv_1 (copy, index: 1) ]] local v14 = tbl_upv_1.ResolveClientWeaponSystem(a1) if not v14 then return nil end local ServerModels_1 = v14:FindFirstChild("ServerModels") if ServerModels_1 and ServerModels_1:IsA("Folder") then return ServerModels_1 end return nil end function tbl_upv_1.CollectAuthoritativeTools(a1) --[[ name: CollectAuthoritativeTools line: 191 upvalues: tbl_upv_1 (copy, index: 1) ]] local tbl_upv_5 = {} local tbl_upv_6 = {} local Character_upv_1 = a1.Character local v15 = a1:FindFirstChildOfClass("Backpack") local function considerTool(a2) --[[ name: considerTool line: 197 upvalues: tbl_upv_1 (copy, index: 1) tbl_upv_6 (copy, index: 2) Character_upv_1 (copy, index: 3) tbl_upv_5 (copy, index: 4) ]] local v16 = tbl_upv_1.GetToolClass(a2) if not v16 then return end local Parent_1 = a2.Parent local v17 if Parent_1 then v17 = Parent_1:IsA("Backpack") or (Parent_1:IsA("Model")) else v17 = false end if v17 ~= true then return end local v18 = tbl_upv_1.GetOrAssignToolSerial(a2) local v19 = tbl_upv_6[v18] if (not v19 or v19.Parent ~= Character_upv_1) and (a2.Parent == Character_upv_1 or v19 == nil) then tbl_upv_6[v18] = a2 tbl_upv_5[v16] = a2 end end if v15 then for _, value_2 in ipairs(v15:GetChildren()) do local v20 = value_2:IsA("Tool") if v20 then considerTool(value_2) end end end if Character_upv_1 then for _, value_3 in ipairs(Character_upv_1:GetChildren()) do local v21 = value_3:IsA("Tool") if v21 then considerTool(value_3) end end end return tbl_upv_5 end function tbl_upv_1.ResolveToolByClass(a1, a2) --[[ name: ResolveToolByClass line: 238 upvalues: tbl_upv_1 (copy, index: 1) ]] return tbl_upv_1.CollectAuthoritativeTools(a1)[a2] end function tbl_upv_1.ResolveEquippedTool(a1) --[[ name: ResolveEquippedTool line: 242 upvalues: tbl_upv_1 (copy, index: 1) ]] local Character_2 = a1.Character if not Character_2 then return nil end for _, value_4 in ipairs(Character_2:GetChildren()) do if not (value_4:IsA("Tool")) or tbl_upv_1.GetToolClass(value_4) == nil then continue end tbl_upv_1.GetOrAssignToolSerial(value_4) return value_4 end local v22 = tbl_upv_1.GetStateFolder(Character_2) local v23 = v22 and (v22:GetAttribute("EquippedSlot")) if typeof(v23) == "string" and v23 ~= "" then return tbl_upv_1.ResolveToolByClass(a1, v23) end return nil end function tbl_upv_1.FindToolBySerial(a1, a2) --[[ name: FindToolBySerial line: 264 upvalues: tbl_upv_1 (copy, index: 1) ]] if typeof(a2) ~= "string" or a2 == "" then return nil end local v24 = a1:FindFirstChildOfClass("Backpack") if v24 then for _, value_5 in ipairs(v24:GetChildren()) do if not (value_5:IsA("Tool")) or tbl_upv_1.GetOrAssignToolSerial(value_5) ~= a2 then continue end return value_5 end local Character_3 = a1.Character if Character_3 then for _, value_6 in ipairs(Character_3:GetChildren()) do if not (value_6:IsA("Tool")) or tbl_upv_1.GetOrAssignToolSerial(value_6) ~= a2 then continue end return value_6 end end return nil else local Character_3 = a1.Character if Character_3 then for _, value_6 in ipairs(Character_3:GetChildren()) do if not (value_6:IsA("Tool")) or tbl_upv_1.GetOrAssignToolSerial(value_6) ~= a2 then continue end return value_6 end end return nil end end function tbl_upv_1.FindToolByName(a1, a2) --[[ name: FindToolByName line: 290 upvalues: tbl_upv_1 (copy, index: 1) ]] if typeof(a2) == "string" and a2 ~= "" then for _, value_7 in pairs(tbl_upv_1.CollectAuthoritativeTools(a1)) do if value_7.Name ~= a2 then continue end return value_7 end end return nil end function tbl_upv_1.ResolveVisibleModel(a1, a2) --[[ name: ResolveVisibleModel line: 305 upvalues: tbl_upv_1 (copy, index: 1) ]] if not a1 or typeof(a2) ~= "string" or a2 == "" then return nil end local v25 = tbl_upv_1.GetServerModelsFolder(a1) if not v25 then return nil end local v26 = v25:FindFirstChild(a2) if v26 and v26:IsA("Model") then return v26 end for _, value_8 in ipairs(v25:GetChildren()) do if not (value_8:IsA("Model")) or value_8:GetAttribute("ToolName") ~= a2 then continue end return value_8 end return nil end function tbl_upv_1.UpdateStateFolder(a1, a2) --[[ name: UpdateStateFolder line: 329 ]] if not a1 then return end for key_2, value_9 in pairs(a2) do if a1:GetAttribute(key_2) ~= value_9 then a1:SetAttribute(key_2, value_9) end end end return table.freeze(tbl_upv_1)