local Players = game:GetService("Players") local StarterGui = game:GetService("StarterGui") local UserInputService = game:GetService("UserInputService") local VoiceChatService = game:GetService("VoiceChatService") local player = Players.LocalPlayer -- System Configuration local MAX_HOTBAR = 5 local clickThreshold = 15 local SLOT_SIZE = 48 local SLOT_PADDING = 10 local INV_SLOT_SIZE = 50 -- Tool Tracking State local hotbarList = {} local inventoryList = {} local currentSearchText = "" -- Feature States local canMoveIcons = false local canMoveHotbar = false -- 1. Disable the default Roblox backpack UI pcall(function() StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) end) -- 2. Create the ScreenGui Container local screenGui = Instance.new("ScreenGui") screenGui.Name = "DeltaInventorySystem" screenGui.ResetOnSpawn = false screenGui.IgnoreGuiInset = true screenGui.Parent = player:WaitForChild("PlayerGui") -- Forward declaration for UI update & Revert function local renderUI local function revertToDefault() pcall(function() StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) end) if screenGui then screenGui:Destroy() end end -- 3. Topbar Container & Icons local baseOffsetX = 105 local isVoiceEnabled = false pcall(function() isVoiceEnabled = VoiceChatService:IsVoiceEnabledForUserIdAsync(player.UserId) end) if isVoiceEnabled then baseOffsetX = baseOffsetX + 45 end local topbarContainer = Instance.new("Frame") topbarContainer.Name = "TopbarContainer" topbarContainer.Size = UDim2.new(0, 85, 0, 36) topbarContainer.Position = UDim2.new(0, baseOffsetX, 0, 4) topbarContainer.BackgroundTransparency = 1 topbarContainer.Parent = screenGui local toggleBtn = Instance.new("TextButton") toggleBtn.Name = "InventoryToggle" toggleBtn.Size = UDim2.new(0, 36, 0, 36) toggleBtn.Position = UDim2.new(0, 0, 0, 0) toggleBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) toggleBtn.BackgroundTransparency = 0.2 toggleBtn.Text = "🎒" toggleBtn.TextScaled = true toggleBtn.Parent = topbarContainer Instance.new("UICorner", toggleBtn).CornerRadius = UDim.new(0, 8) local settingsBtn = Instance.new("TextButton") settingsBtn.Name = "SettingsToggle" settingsBtn.Size = UDim2.new(0, 36, 0, 36) settingsBtn.Position = UDim2.new(0, 45, 0, 0) settingsBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) settingsBtn.BackgroundTransparency = 0.2 settingsBtn.Text = "⚙️" settingsBtn.TextScaled = true settingsBtn.Parent = topbarContainer Instance.new("UICorner", settingsBtn).CornerRadius = UDim.new(0, 8) local function addStroke(gui) local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(150, 150, 150) stroke.Thickness = 1.2 stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border stroke.Parent = gui end addStroke(toggleBtn) addStroke(settingsBtn) -- 4. Dragging Helper Logic local function makeDraggable(frame, triggerObjects, conditionFunc) local dragging, dragStart, startPos for _, obj in ipairs(triggerObjects) do obj.InputBegan:Connect(function(input) if conditionFunc() and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then dragging = true dragStart = input.Position startPos = frame.Position end end) end UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end -- 5. Settings Panel local settingsPanel = Instance.new("Frame") settingsPanel.Name = "SettingsPanel" settingsPanel.Size = UDim2.new(0, 250, 0, 270) settingsPanel.Position = UDim2.new(0.5, -125, 0.4, -135) settingsPanel.BackgroundColor3 = Color3.fromRGB(25, 25, 25) settingsPanel.BackgroundTransparency = 0.1 settingsPanel.Visible = false settingsPanel.Parent = screenGui Instance.new("UICorner", settingsPanel).CornerRadius = UDim.new(0, 10) addStroke(settingsPanel) local setLayout = Instance.new("UIListLayout") setLayout.Padding = UDim.new(0, 10) setLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center setLayout.Parent = settingsPanel local setPadding = Instance.new("UIPadding") setPadding.PaddingTop = UDim.new(0, 15) setPadding.Parent = settingsPanel local setLabel = Instance.new("TextLabel") setLabel.Size = UDim2.new(1, 0, 0, 20) setLabel.BackgroundTransparency = 1 setLabel.Text = "Inventory Settings" setLabel.TextColor3 = Color3.fromRGB(255, 255, 255) setLabel.Font = Enum.Font.Code setLabel.TextSize = 18 setLabel.Parent = settingsPanel local function createToggle(name, text, callback) local frame = Instance.new("Frame") frame.Size = UDim2.new(0.9, 0, 0, 30) frame.BackgroundTransparency = 1 frame.Parent = settingsPanel local label = Instance.new("TextLabel") label.Size = UDim2.new(0.7, 0, 1, 0) label.BackgroundTransparency = 1 label.Text = text label.TextColor3 = Color3.fromRGB(200, 200, 200) label.Font = Enum.Font.Code label.TextSize = 14 label.TextXAlignment = Enum.TextXAlignment.Left label.Parent = frame local btn = Instance.new("TextButton") btn.Size = UDim2.new(0.3, 0, 0.8, 0) btn.Position = UDim2.new(0.7, 0, 0.1, 0) btn.BackgroundColor3 = Color3.fromRGB(150, 50, 50) btn.Text = "OFF" btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Font = Enum.Font.Code btn.Parent = frame Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6) local state = false btn.MouseButton1Click:Connect(function() state = not state btn.BackgroundColor3 = state and Color3.fromRGB(50, 150, 50) or Color3.fromRGB(150, 50, 50) btn.Text = state and "ON" or "OFF" callback(state) end) end local function createCounter(labelName, getVal, setVal, minVal, maxVal) local frame = Instance.new("Frame") frame.Size = UDim2.new(0.9, 0, 0, 30) frame.BackgroundTransparency = 1 frame.Parent = settingsPanel local label = Instance.new("TextLabel") label.Size = UDim2.new(0.5, 0, 1, 0) label.BackgroundTransparency = 1 label.Text = labelName label.TextColor3 = Color3.fromRGB(200, 200, 200) label.Font = Enum.Font.Code label.TextSize = 14 label.TextXAlignment = Enum.TextXAlignment.Left label.Parent = frame local minusBtn = Instance.new("TextButton") minusBtn.Size = UDim2.new(0.12, 0, 0.8, 0) minusBtn.Position = UDim2.new(0.55, 0, 0.1, 0) minusBtn.Text = "-" minusBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 50) minusBtn.TextColor3 = Color3.fromRGB(255, 255, 255) minusBtn.Parent = frame Instance.new("UICorner", minusBtn).CornerRadius = UDim.new(0, 4) local valLabel = Instance.new("TextLabel") valLabel.Size = UDim2.new(0.18, 0, 0.8, 0) valLabel.Position = UDim2.new(0.68, 0, 0.1, 0) valLabel.BackgroundTransparency = 1 valLabel.Text = tostring(getVal()) valLabel.TextColor3 = Color3.fromRGB(255, 255, 255) valLabel.Font = Enum.Font.Code valLabel.TextSize = 14 valLabel.Parent = frame local plusBtn = Instance.new("TextButton") plusBtn.Size = UDim2.new(0.12, 0, 0.8, 0) plusBtn.Position = UDim2.new(0.87, 0, 0.1, 0) plusBtn.Text = "+" plusBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 50) plusBtn.TextColor3 = Color3.fromRGB(255, 255, 255) plusBtn.Parent = frame Instance.new("UICorner", plusBtn).CornerRadius = UDim.new(0, 4) minusBtn.MouseButton1Click:Connect(function() local current = getVal() if current > minVal then setVal(current - 1) valLabel.Text = tostring(getVal()) if renderUI then renderUI() end end end) plusBtn.MouseButton1Click:Connect(function() local current = getVal() if current < maxVal then setVal(current + 1) valLabel.Text = tostring(getVal()) if renderUI then renderUI() end end end) end createCounter("Hotbar Size", function() return SLOT_SIZE end, function(v) SLOT_SIZE = v end, 25, 80) createCounter("Hotbar Slots", function() return MAX_HOTBAR end, function(v) MAX_HOTBAR = v while #hotbarList > MAX_HOTBAR do table.insert(inventoryList, table.remove(hotbarList)) end end, 1, 10) createToggle("IconMover", "Move Icons", function(state) canMoveIcons = state end) createToggle("HotbarMover", "Move Hotbar", function(state) canMoveHotbar = state end) -- Revert Button Inside Settings local revertContainer = Instance.new("Frame") revertContainer.Size = UDim2.new(0.9, 0, 0, 35) revertContainer.BackgroundTransparency = 1 revertContainer.Parent = settingsPanel local revertBtn = Instance.new("TextButton") revertBtn.Size = UDim2.new(1, 0, 1, 0) revertBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40) revertBtn.Text = "REVERT TO DEFAULT" revertBtn.TextColor3 = Color3.fromRGB(255, 255, 255) revertBtn.Font = Enum.Font.Code revertBtn.TextSize = 14 revertBtn.Parent = revertContainer Instance.new("UICorner", revertBtn).CornerRadius = UDim.new(0, 6) addStroke(revertBtn) revertBtn.MouseButton1Click:Connect(revertToDefault) makeDraggable(topbarContainer, {toggleBtn, settingsBtn}, function() return canMoveIcons end) -- 6. Inventory Container & Search Bar local invContainer = Instance.new("Frame") invContainer.Name = "InventoryContainer" invContainer.Size = UDim2.new(0.6, 0, 0.5, 0) invContainer.Position = UDim2.new(0.2, 0, 0.25, 0) invContainer.BackgroundColor3 = Color3.fromRGB(25, 25, 25) invContainer.BackgroundTransparency = 0.2 invContainer.BorderSizePixel = 0 invContainer.Visible = false invContainer.Parent = screenGui Instance.new("UICorner", invContainer).CornerRadius = UDim.new(0, 12) addStroke(invContainer) -- Drop Box with Warning Label local dropBox = Instance.new("Frame") dropBox.Name = "DropBox" dropBox.Size = UDim2.new(0, 95, 0, 120) dropBox.Position = UDim2.new(1, 10, 0, 0) dropBox.BackgroundColor3 = Color3.fromRGB(150, 40, 40) dropBox.BackgroundTransparency = 0.3 dropBox.Visible = false dropBox.Parent = invContainer Instance.new("UICorner", dropBox).CornerRadius = UDim.new(0, 8) addStroke(dropBox) local dropBoxText = Instance.new("TextLabel") dropBoxText.Size = UDim2.new(1, 0, 0, 40) dropBoxText.Position = UDim2.new(0, 0, 0, 10) dropBoxText.BackgroundTransparency = 1 dropBoxText.Text = "DROP" dropBoxText.TextColor3 = Color3.fromRGB(255, 255, 255) dropBoxText.Font = Enum.Font.Code dropBoxText.TextSize = 18 dropBoxText.TextScaled = true dropBoxText.Parent = dropBox local dropWarning = Instance.new("TextLabel") dropWarning.Size = UDim2.new(1, -8, 0, 60) dropWarning.Position = UDim2.new(0, 4, 0, 55) dropWarning.BackgroundTransparency = 1 dropWarning.Text = "This doesnt work in some games" dropWarning.TextColor3 = Color3.fromRGB(220, 220, 220) dropWarning.Font = Enum.Font.Code dropWarning.TextSize = 11 dropWarning.TextWrapped = true dropWarning.TextXAlignment = Enum.TextXAlignment.Center dropWarning.Parent = dropBox -- Toggle DropBox visibility along with inventory toggleBtn.MouseButton1Click:Connect(function() invContainer.Visible = not invContainer.Visible dropBox.Visible = invContainer.Visible end) settingsBtn.MouseButton1Click:Connect(function() settingsPanel.Visible = not settingsPanel.Visible end) local searchIcon = Instance.new("TextLabel") searchIcon.Size = UDim2.new(0, 30, 0, 35) searchIcon.Position = UDim2.new(0, 15, 0, 10) searchIcon.BackgroundTransparency = 1 searchIcon.Text = "🔎" searchIcon.TextScaled = true searchIcon.Parent = invContainer local searchInput = Instance.new("TextBox") searchInput.Size = UDim2.new(1, -65, 0, 35) searchInput.Position = UDim2.new(0, 50, 0, 10) searchInput.BackgroundColor3 = Color3.fromRGB(15, 15, 15) searchInput.BackgroundTransparency = 0.3 searchInput.TextColor3 = Color3.fromRGB(200, 200, 200) searchInput.Text = "" searchInput.PlaceholderText = "Search" searchInput.Font = Enum.Font.Code searchInput.TextSize = 16 searchInput.ClearTextOnFocus = false searchInput.Parent = invContainer Instance.new("UICorner", searchInput).CornerRadius = UDim.new(0, 6) addStroke(searchInput) local invScroll = Instance.new("ScrollingFrame") invScroll.Size = UDim2.new(1, 0, 1, -55) invScroll.Position = UDim2.new(0, 0, 0, 55) invScroll.BackgroundTransparency = 1 invScroll.BorderSizePixel = 0 invScroll.ScrollBarThickness = 6 invScroll.Parent = invContainer local gridLayout = Instance.new("UIGridLayout") gridLayout.CellSize = UDim2.new(0, INV_SLOT_SIZE, 0, INV_SLOT_SIZE) gridLayout.CellPadding = UDim2.new(0, 10, 0, 10) gridLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center gridLayout.SortOrder = Enum.SortOrder.LayoutOrder gridLayout.Parent = invScroll local gridPadding = Instance.new("UIPadding") gridPadding.PaddingTop = UDim.new(0, 5) gridPadding.Parent = invScroll -- 7. Unified Hotbar Frame local hotbarFrame = Instance.new("Frame") hotbarFrame.Name = "HotbarFrame" hotbarFrame.AnchorPoint = Vector2.new(0.5, 0) hotbarFrame.Position = UDim2.new(0.5, 0, 0.85, 0) hotbarFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) hotbarFrame.BackgroundTransparency = 0.3 hotbarFrame.Parent = screenGui Instance.new("UICorner", hotbarFrame).CornerRadius = UDim.new(0, 16) addStroke(hotbarFrame) local listLayout = Instance.new("UIListLayout") listLayout.FillDirection = Enum.FillDirection.Horizontal listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center listLayout.VerticalAlignment = Enum.VerticalAlignment.Center listLayout.Padding = UDim.new(0, SLOT_PADDING) listLayout.Parent = hotbarFrame makeDraggable(hotbarFrame, {hotbarFrame}, function() return canMoveHotbar end) -- 8. Core Mechanics local function isInside(pos, guiObject) if not guiObject.Visible then return false end local tl = guiObject.AbsolutePosition local br = tl + guiObject.AbsoluteSize return pos.X >= tl.X and pos.X <= br.X and pos.Y >= tl.Y and pos.Y <= br.Y end local function triggerDrop(tool) if not tool then return end tool.CanBeDropped = true tool.Parent = workspace local handle = tool:FindFirstChild("Handle") if handle and handle:IsA("BasePart") then local character = player.Character local hrp = character and character:FindFirstChild("HumanoidRootPart") if hrp then task.wait() handle.AssemblyLinearVelocity = (hrp.CFrame.LookVector * 15) + Vector3.new(0, 10, 0) end end end local function syncTools() local character = player.Character or player.CharacterAdded:Wait() local backpack = player:WaitForChild("Backpack") local currentTools = {} for _, item in ipairs(backpack:GetChildren()) do if item:IsA("Tool") then currentTools[item] = true end end for _, item in ipairs(character:GetChildren()) do if item:IsA("Tool") then currentTools[item] = true end end for i = #hotbarList, 1, -1 do if not currentTools[hotbarList[i]] then table.remove(hotbarList, i) end end for i = #inventoryList, 1, -1 do if not currentTools[inventoryList[i]] then table.remove(inventoryList, i) end end for tool in pairs(currentTools) do if not table.find(hotbarList, tool) and not table.find(inventoryList, tool) then if #hotbarList < MAX_HOTBAR then table.insert(hotbarList, tool) else table.insert(inventoryList, tool) end end end end renderUI = function() for _, child in ipairs(invScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end for _, child in ipairs(hotbarFrame:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end local hotbarWidth = (MAX_HOTBAR * SLOT_SIZE) + ((MAX_HOTBAR - 1) * SLOT_PADDING) + 12 hotbarFrame.Size = UDim2.new(0, hotbarWidth, 0, SLOT_SIZE + 10) local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local function createSlot(tool, parentFrame) local btn = Instance.new("TextButton") btn.Name = tool.Name btn.Text = tool.Name btn.TextColor3 = Color3.fromRGB(200, 200, 200) btn.Font = Enum.Font.Code btn.TextScaled = true btn.Parent = parentFrame local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = btn local stroke = Instance.new("UIStroke") stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border stroke.Parent = btn if parentFrame == hotbarFrame then btn.Size = UDim2.new(0, SLOT_SIZE, 0, SLOT_SIZE) btn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) btn.BackgroundTransparency = 0.4 stroke.Thickness = 1 if tool.Parent == character then btn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) stroke.Color = Color3.fromRGB(220, 220, 220) else stroke.Color = Color3.fromRGB(100, 100, 100) end else btn.Size = UDim2.new(0, INV_SLOT_SIZE, 0, INV_SLOT_SIZE) btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40) btn.BackgroundTransparency = 0.2 stroke.Thickness = 1.2 if tool.Parent == character then stroke.Color = Color3.fromRGB(220, 220, 220) btn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) else stroke.Color = Color3.fromRGB(100, 100, 100) end end local dragging = false local dragInput, dragStart, ghostBtn local lastClickTick = 0 btn.InputBegan:Connect(function(input) if not dragging and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then dragging = true dragInput = input dragStart = input.Position end end) UserInputService.InputChanged:Connect(function(input) if dragging and input == dragInput then local delta = input.Position - dragStart if delta.Magnitude >= clickThreshold then if not ghostBtn then ghostBtn = Instance.new("TextButton") ghostBtn.Size = btn.Size ghostBtn.Text = tool.Name ghostBtn.TextScaled = true ghostBtn.Font = Enum.Font.Code ghostBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) ghostBtn.BackgroundTransparency = 0.5 ghostBtn.ZIndex = 10 ghostBtn.AnchorPoint = Vector2.new(0.5, 0.5) Instance.new("UICorner", ghostBtn).CornerRadius = UDim.new(0, 8) ghostBtn.Parent = screenGui btn.TextTransparency = 0.8 btn.BackgroundTransparency = 0.8 end ghostBtn.Position = UDim2.new(0, input.Position.X, 0, input.Position.Y) end end end) UserInputService.InputEnded:Connect(function(input) if dragging and input == dragInput then dragging = false local delta = input.Position - dragStart if ghostBtn then local dropPos = input.Position ghostBtn:Destroy() ghostBtn = nil if isInside(dropPos, dropBox) then local invIdx = table.find(inventoryList, tool) if invIdx then table.remove(inventoryList, invIdx) end local hotIdx = table.find(hotbarList, tool) if hotIdx then table.remove(hotbarList, hotIdx) end triggerDrop(tool) elseif isInside(dropPos, hotbarFrame) then if not table.find(hotbarList, tool) then local invIdx = table.find(inventoryList, tool) if invIdx then table.remove(inventoryList, invIdx) end if #hotbarList >= MAX_HOTBAR then table.insert(inventoryList, table.remove(hotbarList, 1)) end table.insert(hotbarList, tool) end elseif isInside(dropPos, invContainer) then if not table.find(inventoryList, tool) then local hotIdx = table.find(hotbarList, tool) if hotIdx then table.remove(hotbarList, hotIdx) end table.insert(inventoryList, tool) end end renderUI() else if delta.Magnitude < clickThreshold then if parentFrame == invScroll then local currentTick = tick() if currentTick - lastClickTick < 0.35 then if #hotbarList < MAX_HOTBAR then local invIdx = table.find(inventoryList, tool) if invIdx then table.remove(inventoryList, invIdx) table.insert(hotbarList, tool) renderUI() end end lastClickTick = 0 else lastClickTick = currentTick end else if tool.Parent == character then humanoid:UnequipTools() else humanoid:EquipTool(tool) end renderUI() end end end dragInput = nil end end) end for _, tool in ipairs(hotbarList) do createSlot(tool, hotbarFrame) end for _, tool in ipairs(inventoryList) do if currentSearchText == "" or string.find(string.lower(tool.Name), currentSearchText, 1, true) then createSlot(tool, invScroll) end end end _G.updateUI = renderUI -- 9. Main Loop & Listeners local function update() syncTools() renderUI() end searchInput:GetPropertyChangedSignal("Text"):Connect(function() currentSearchText = string.lower(searchInput.Text) renderUI() end) local function setupListeners() local backpack = player:WaitForChild("Backpack") backpack.ChildAdded:Connect(update) backpack.ChildRemoved:Connect(update) if player.Character then player.Character.ChildAdded:Connect(update) player.Character.ChildRemoved:Connect(update) end end player.CharacterAdded:Connect(function() task.wait(0.5) setupListeners() update() end) setupListeners() update()