-- Script to create a GUI for selecting and retrieving tools -- Create the ScreenGui local gui = Instance.new("ScreenGui") gui.Name = "ToolSelectorGUI" gui.Parent = game.CoreGui gui.Enabled = false -- Start hidden -- Create the Toggle Button local toggleButton = Instance.new("TextButton") toggleButton.Size = UDim2.new(0, 100, 0, 50) toggleButton.Position = UDim2.new(0.02, 0, 0.9, 0) -- Bottom left corner toggleButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) toggleButton.Text = "Open Menu" toggleButton.Font = Enum.Font.SourceSansBold toggleButton.TextSize = 18 toggleButton.Parent = gui -- Create the Main Frame local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 300, 0, 400) frame.Position = UDim2.new(0.5, -150, 0.5, -200) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Parent = gui -- Make the Frame Scrollable local scrollingFrame = Instance.new("ScrollingFrame") scrollingFrame.Size = UDim2.new(1, 0, 1, 0) scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0) -- Will adjust dynamically scrollingFrame.ScrollBarThickness = 8 scrollingFrame.BackgroundTransparency = 1 scrollingFrame.Parent = frame -- Add a UIListLayout for buttons inside the scrolling frame local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 5) layout.FillDirection = Enum.FillDirection.Vertical layout.HorizontalAlignment = Enum.HorizontalAlignment.Center layout.SortOrder = Enum.SortOrder.LayoutOrder layout.Parent = scrollingFrame -- Add Title local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 50) title.Text = "Tool Selector" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.BackgroundColor3 = Color3.fromRGB(50, 50, 50) title.Font = Enum.Font.SourceSansBold title.TextSize = 24 title.Parent = frame -- Adjust Canvas Size based on content layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 10) end) -- Function to interact with a specific item local function interactWithItem(item) if item:FindFirstChild("InteractRemote") then item:WaitForChild("InteractRemote"):FireServer(game.Players.LocalPlayer) print("Interacted with:", item.Name) else warn("No InteractRemote found for", item.Name) end end -- Function to add a button for each item local function addButton(item) local button = Instance.new("TextButton") button.Size = UDim2.new(0.8, 0, 0, 40) button.Text = "Get " .. item.Name button.TextColor3 = Color3.fromRGB(255, 255, 255) button.BackgroundColor3 = Color3.fromRGB(70, 70, 70) button.Font = Enum.Font.SourceSansBold button.TextSize = 18 -- Button click event button.MouseButton1Click:Connect(function() interactWithItem(item) end) button.Parent = scrollingFrame end -- Function to search all presets and list items in the GUI local function listAllItemsInGUI() for i = 1, 10 do local preset = workspace:FindFirstChild("Preset" .. i) if preset then for _, obj in pairs(preset:GetChildren()) do if obj:FindFirstChild("InteractRemote") then addButton(obj) -- Add a button for each item found end end end end end -- Toggle GUI visibility with Right Ctrl (PC) or Button (Mobile) local function toggleGUI() gui.Enabled = not gui.Enabled toggleButton.Text = gui.Enabled and "Close Menu" or "Open Menu" end toggleButton.MouseButton1Click:Connect(toggleGUI) -- Mobile button click game:GetService("UserInputService").InputBegan:Connect(function(input, isProcessed) if not isProcessed and input.KeyCode == Enum.KeyCode.RightControl then toggleGUI() end end) -- Trigger the item listing print("Loading items into GUI...") listAllItemsInGUI() print("Tool Selector GUI loaded successfully!")