local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local LocalPlayer = Players.LocalPlayer -- Create the ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "AutoDigAndSellGui" screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") screenGui.ResetOnSpawn = false -- Create the main Frame local frame = Instance.new("Frame") frame.Name = "MainFrame" frame.Size = UDim2.new(0, 200, 0, 190) -- Increased height to accommodate new button frame.Position = UDim2.new(0.5, -100, 0.5, -95) frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) frame.BorderSizePixel = 0 frame.Parent = screenGui -- Make the frame draggable local dragging = false local dragInput local dragStart local startPos frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then dragInput = input end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if input == dragInput and dragging 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) -- Title Label local titleLabel = Instance.new("TextLabel") titleLabel.Name = "Title" titleLabel.Size = UDim2.new(1, 0, 0, 30) titleLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30) titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.Text = "Auto Digger & Seller" titleLabel.Font = Enum.Font.SourceSansBold titleLabel.TextSize = 18 titleLabel.Parent = frame -- 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, 50, 50) closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.Text = "X" closeButton.Font = Enum.Font.SourceSansBold closeButton.TextSize = 18 closeButton.Parent = frame closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end) -- Cooldown Label local cooldownLabel = Instance.new("TextLabel") cooldownLabel.Name = "CooldownLabel" cooldownLabel.Size = UDim2.new(1, 0, 0, 30) cooldownLabel.Position = UDim2.new(0, 0, 0, 30) cooldownLabel.BackgroundTransparency = 1 cooldownLabel.TextColor3 = Color3.fromRGB(255, 255, 255) cooldownLabel.Text = "Dig Cooldown (sec):" cooldownLabel.Font = Enum.Font.SourceSans cooldownLabel.TextSize = 14 cooldownLabel.Parent = frame -- Cooldown TextBox local cooldownTextBox = Instance.new("TextBox") cooldownTextBox.Name = "CooldownTextBox" cooldownTextBox.Size = UDim2.new(1, -10, 0, 30) cooldownTextBox.Position = UDim2.new(0, 5, 0, 60) cooldownTextBox.BackgroundColor3 = Color3.fromRGB(70, 70, 70) cooldownTextBox.TextColor3 = Color3.fromRGB(255, 255, 255) cooldownTextBox.Text = "0.5" cooldownTextBox.Font = Enum.Font.SourceSans cooldownTextBox.TextSize = 14 cooldownTextBox.Parent = frame -- Activate Digging Button (Toggle) local activateButton = Instance.new("TextButton") activateButton.Name = "ActivateButton" activateButton.Size = UDim2.new(1, -10, 0, 40) activateButton.Position = UDim2.new(0, 5, 0, 100) activateButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50) activateButton.TextColor3 = Color3.fromRGB(255, 255, 255) activateButton.Text = "Start Digging" activateButton.Font = Enum.Font.SourceSansBold activateButton.TextSize = 18 activateButton.Parent = frame -- Sell Inventory Button local sellButton = Instance.new("TextButton") sellButton.Name = "SellButton" sellButton.Size = UDim2.new(1, -10, 0, 40) sellButton.Position = UDim2.new(0, 5, 0, 145) sellButton.BackgroundColor3 = Color3.fromRGB(50, 150, 200) sellButton.TextColor3 = Color3.fromRGB(255, 255, 255) sellButton.Text = "Sell Inventory" sellButton.Font = Enum.Font.SourceSansBold sellButton.TextSize = 18 sellButton.Parent = frame -- Variables for the digging loop local isActive = false local connection -- Function to run the digging process local function runDigging() local network = ReplicatedStorage:WaitForChild("Network") local remoteFunctions = network:WaitForChild("RemoteFunctions") local startDigging = remoteFunctions:WaitForChild("StartDigging") local remoteEvents = network:WaitForChild("RemoteEvents") local endDigging = remoteEvents:WaitForChild("EndDigging") startDigging:InvokeServer() local args = { [1] = "Succeeded" } endDigging:FireServer(unpack(args)) end -- Function to sell inventory local function sellInventory() local network = ReplicatedStorage:WaitForChild("Network") local remoteEvents = network:WaitForChild("RemoteEvents") local pawnShop = remoteEvents:WaitForChild("PawnShopInteraction") local args = { [1] = "SellInventory" } pawnShop:FireServer(unpack(args)) end -- Toggle digging functionality activateButton.MouseButton1Click:Connect(function() isActive = not isActive if isActive then activateButton.Text = "Stop Digging" activateButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) connection = game:GetService("RunService").Heartbeat:Connect(function() local cooldown = tonumber(cooldownTextBox.Text) or 0.5 runDigging() wait(cooldown) end) else activateButton.Text = "Start Digging" activateButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50) if connection then connection:Disconnect() connection = nil end end end) -- Sell inventory button functionality sellButton.MouseButton1Click:Connect(function() sellInventory() end)