Inventory helper
Key RequiredUniversal

Inventory helper

Universal ScriptGen_alpha_scripterGen_alpha_scripter 4K views 43 executesUpdated Dec 2, 2024
Unrated
00
Lua Script•105 lines (3610 chars)
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Parent = game.CoreGui

local Button = Instance.new("TextButton")
Button.Text = "Show Inventory"
Button.Size = UDim2.new(0, 150, 0, 50)
Button.Position = UDim2.new(0.5, -75, 0.25, 0)
Button.Active = true
Button.Draggable = true
Button.Parent = ScreenGui

local scrollingFrame = Instance.new("ScrollingFrame")
scrollingFrame.Parent = ScreenGui
scrollingFrame.Size = UDim2.new(0, 400, 0, 300)
scrollingFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
scrollingFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
scrollingFrame.ScrollBarThickness = 12
scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
scrollingFrame.Visible = false

local totalLabel = Instance.new("TextLabel")
totalLabel.Parent = scrollingFrame
totalLabel.Size = UDim2.new(1, 0, 0, 30)
totalLabel.Position = UDim2.new(0, 0, 0, 0)
totalLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
totalLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
totalLabel.Text = "Total Items: 0"
totalLabel.TextSize = 18

local searchBox = Instance.new("TextBox")
searchBox.Parent = ScreenGui
searchBox.Size = UDim2.new(0, 400, 0, 30)
searchBox.Position = UDim2.new(0.5, -200, 0.5, -190)
searchBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
searchBox.TextColor3 = Color3.fromRGB(255, 255, 255)
searchBox.PlaceholderText = "Search for an item..."
searchBox.TextSize = 18
searchBox.Visible = false

local function showInventory()
    if scrollingFrame.Visible then
        scrollingFrame.Visible = false
        searchBox.Visible = false
    else
        local player = game.Players.LocalPlayer
        local backpack = player:WaitForChild("Backpack")

        local itemCount = {}
        for _, item in pairs(backpack:GetChildren()) do
            if item:IsA("Tool") then
                itemCount[item.Name] = (itemCount[item.Name] or 0) + 1
            end
        end

        local totalItems = 0
        for _, count in pairs(itemCount) do
            totalItems = totalItems + count
        end
        totalLabel.Text = "Total Items: " .. totalItems

        for _, child in pairs(scrollingFrame:GetChildren()) do
            if child:IsA("TextLabel") and child ~= totalLabel then
                child:Destroy()
            end
        end

        local yPosition = 35
        for itemName, count in pairs(itemCount) do
            local itemLabel = Instance.new("TextLabel")
            itemLabel.Parent = scrollingFrame
            itemLabel.Size = UDim2.new(0, 380, 0, 30)
            itemLabel.Position = UDim2.new(0, 10, 0, yPosition)
            itemLabel.Text = itemName .. ": " .. count
            itemLabel.TextSize = 18
            itemLabel.BackgroundTransparency = 1
            itemLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
            itemLabel.TextWrapped = true
            itemLabel.Name = itemName
            yPosition = yPosition + 35
        end

        scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, yPosition)

        scrollingFrame.Visible = true
        searchBox.Visible = true
    end
end

searchBox.Changed:Connect(function(property)
    if property == "Text" then
        local searchText = searchBox.Text:lower()

        for _, itemLabel in pairs(scrollingFrame:GetChildren()) do
            if itemLabel:IsA("TextLabel") and itemLabel ~= totalLabel then
                if searchText == "" or itemLabel.Name:lower():find(searchText) then
                    itemLabel.Visible = true
                else
                    itemLabel.Visible = false
                end
            end
        end
    end
end)

Button.MouseButton1Click:Connect(showInventory)

Features & Information

It will help you see how many items are in your inventory, what item and how many it is

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts