-- Остаточна версія: Розширений Інвентар + DROP (Стійкий до смерті) local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local StarterGui = game:GetService("StarterGui") local LocalPlayer = Players.LocalPlayer -- Вимикаємо стандартний обмежений інвентар Roblox StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- Очищення старих копій скрипта (якщо вони зависли в пам'яті Delta) local oldGui = game:GetService("CoreGui"):FindFirstChild("DeltaMegaInventoryGui") if oldGui then oldGui:Destroy() end -- Створення головного GUI контейнера local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "DeltaMegaInventoryGui" ScreenGui.Parent = game:GetService("CoreGui") ScreenGui.ResetOnSpawn = false -- Захист від видалення інтерфейсу грою -- Створення прокручуваної панелі інвентарю local ScrollingFrame = Instance.new("ScrollingFrame") ScrollingFrame.Parent = ScreenGui ScrollingFrame.Size = UDim2.new(0.6, 0, 0.12, 0) ScrollingFrame.Position = UDim2.new(0.2, 0, 0.85, 0) -- Знизу екрана по центру ScrollingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) ScrollingFrame.BackgroundTransparency = 0.4 ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0) ScrollingFrame.ScrollBarThickness = 4 ScrollingFrame.Active = true local UIListLayout = Instance.new("UIListLayout") UIListLayout.Parent = ScrollingFrame UIListLayout.FillDirection = Enum.FillDirection.Horizontal UIListLayout.Padding = UDim.new(0, 5) UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Center -- Створення кнопки DROP (на старому зручному місці) local DropButton = Instance.new("TextButton") local DropCorner = Instance.new("UICorner") DropButton.Name = "DropButton" DropButton.Parent = ScreenGui DropButton.Size = UDim2.new(0, 60, 0, 60) DropButton.Position = UDim2.new(0.85, 0, 0.35, 0) DropButton.BackgroundColor3 = Color3.fromRGB(240, 70, 70) DropButton.Text = "DROP" DropButton.TextColor3 = Color3.fromRGB(255, 255, 255) DropButton.Font = Enum.Font.SourceSansBold DropButton.TextSize = 16 DropButton.Active = true DropButton.Draggable = true DropCorner.CornerRadius = UDim.new(0, 30) DropCorner.Parent = DropButton -- Розумна функція, яка завжди шукає новий рюкзак і оновлює слоти local function refreshInventory() -- Очищаємо візуальні кнопки перед перемальовкою for _, child in ipairs(ScrollingFrame:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end -- Завжди беремо найсвіжіший рюкзак та персонажа local activeBackpack = LocalPlayer:FindFirstChildOfClass("Backpack") local currentCharacter = LocalPlayer.Character local tools = {} if activeBackpack then for _, t in ipairs(activeBackpack:GetChildren()) do if t:IsA("Tool") then table.insert(tools, t) end end end if currentCharacter then for _, t in ipairs(currentCharacter:GetChildren()) do if t:IsA("Tool") then table.insert(tools, t) end end end -- Створюємо слоти для предметів for _, tool in ipairs(tools) do local ToolButton = Instance.new("TextButton") local ToolCorner = Instance.new("UICorner") ToolButton.Size = UDim2.new(0, 70, 0, 70) ToolButton.BackgroundColor3 = (tool.Parent == currentCharacter) and Color3.fromRGB(80, 150, 255) or Color3.fromRGB(60, 60, 60) ToolButton.Text = tool.Name ToolButton.TextColor3 = Color3.fromRGB(255, 255, 255) ToolButton.TextWrapped = true ToolButton.Font = Enum.Font.SourceSans ToolButton.TextSize = 12 ToolButton.Parent = ScrollingFrame ToolCorner.CornerRadius = UDim.new(0, 10) ToolCorner.Parent = ToolButton ToolButton.MouseButton1Click:Connect(function() local char = LocalPlayer.Character if char and char:FindFirstChild("Humanoid") then if tool.Parent == char then char.Humanoid:UnequipTools() else char.Humanoid:EquipTool(tool) end end end) end ScrollingFrame.CanvasSize = UDim2.new(0, #tools * 75, 0, 0) end -- Динамічне підключення тригерів, яке автоматично перезапускається після смерті local function setupConnections() local currentCharacter = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local activeBackpack = LocalPlayer:WaitForChild("Backpack") -- Слідкуємо за змінами в поточному інвентарі local bAdd = activeBackpack.ChildAdded:Connect(refreshInventory) local bRem = activeBackpack.ChildRemoved:Connect(refreshInventory) local cAdd = currentCharacter.ChildAdded:Connect(refreshInventory) local cRem = currentCharacter.ChildRemoved:Connect(refreshInventory) -- Якщо персонаж помре — відключаємо старі зв'язки і чекаємо новий респавн local deathConnection deathConnection = currentCharacter:WaitForChild("Humanoid").Died:Connect(function() bAdd:Disconnect() bRem:Disconnect() cAdd:Disconnect() cRem:Disconnect() deathConnection:Disconnect() end) refreshInventory() end -- Запуск відстеження при кожному новому відродженні (CharacterAdded) LocalPlayer.CharacterAdded:Connect(function() task.wait(0.8) -- Невелика пауза, поки гра створює новий Backpack після смерті StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- Повторно приховуємо стандартний інтерфейс setupConnections() end) -- Перший запуск при інжекте скрипта if LocalPlayer.Character then setupConnections() end -- Логіка мобільного DROP (викидання без збоїв джойстика) DropButton.MouseButton1Click:Connect(function() local character = LocalPlayer.Character if character then local tool = character:FindFirstChildOfClass("Tool") if tool then local spawnPart = character:FindFirstChild("RightArm") or character:FindFirstChild("RightHand") or character:FindFirstChild("HumanoidRootPart") tool.Parent = Workspace if spawnPart then tool:MoveTo(spawnPart.Position + (spawnPart.CFrame.LookVector * 4)) end end end end)