local ReplicatedStorage = game:GetService("ReplicatedStorage") local Knit = require(ReplicatedStorage.Packages.Knit) -- Получаем сервисы local InventoryController = Knit.GetController("InventoryController") local EquipmentService = Knit.GetService("EquipmentService") -- Функция: достаём вес из ключа local function getWeight(key) local parts = string.split(key, "|") return tonumber(parts[2]) or 0 end -- Функция: экипировать 2 самых тяжёлых предмета (не Egg) local function equipTwoHeaviest() local items = {} -- Собираем предметы for _, stack in ipairs(InventoryController.InventoryLayout) do if stack and stack.Key and stack.Count > 0 then if not string.find(stack.Key, "Egg") then table.insert(items, stack) end end end -- Сортируем по весу (убывание) table.sort(items, function(a, b) return getWeight(a.Key) > getWeight(b.Key) end) -- Берём первые два и экипируем for i = 1, math.min(2, #items) do local stack = items[i] print("Экипируем:", stack.Key, "вес:", getWeight(stack.Key), "stackId:", stack.stackId) EquipmentService:EquipItem(stack.Key, stack.stackId) end end -- Авто каждые 0.5 сек while task.wait(2) do equipTwoHeaviest() end