What's new
Heapleak - Scripthub

Get the most out of HeapLeak by creating a free account! Once signed in, you’ll gain full access to restricted content, be able to share your own scripts, and participate in our member-only discussions.

OPENSOURCE auto farm ice

Version / Update: v1.0.0
Download / Script Link
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local function getCharacter()
return player.Character or player.CharacterAdded:Wait()
end

local character = getCharacter()
local hrp = character:WaitForChild("HumanoidRootPart")

local obbyFolder = workspace:WaitForChild("SpawnArea"):WaitForChild("Obby")

local running = false
local cancelHold = false

-- mobile touch cancel for prompts
UIS.TouchStarted:Connect(function()
cancelHold = true
end)

-- gui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "auto farm"
screenGui.ResetOnSpawn = false
screenGui.Parent = player:WaitForChild("PlayerGui")

local main = Instance.new("Frame")
main.Size = UDim2.new(0, 140, 0, 60)
main.Position = UDim2.new(0.5, -70, 0.5, -30)
main.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
main.BorderSizePixel = 0
main.Active = true
main.Draggable = true
main.Parent = screenGui

local button = Instance.new("TextButton")
button.Size = UDim2.new(1, -10, 1, -10)
button.Position = UDim2.new(0, 5, 0, 5)
button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
button.BorderSizePixel = 0
button.Text = "Farm: OFF"
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.TextScaled = true
button.Font = Enum.Font.SourceSans
button.Parent = main

local function teleportToStage(stageNumber)
local stage = obbyFolder:FindFirstChild("Stage" .. stageNumber)
if not stage then return end

local part = stage:FindFirstChild(tostring(stageNumber))
if part then
hrp.CFrame = part.CFrame + Vector3.new(0, 3, 0)
end
end

local function getNearestPrompt()
local closest
local shortest = math.huge

for _, obj in ipairs(workspace:GetDescendants()) do
if obj:IsA("ProximityPrompt") and obj.Enabled then
local parent = obj.Parent
if parent and parent:IsA("BasePart") then
local dist = (hrp.Position - parent.Position).Magnitude
if dist < shortest then
shortest = dist
closest = obj
end
end
end
end

return closest
end

button.MouseButton1Click:Connect(function()
running = not running
button.Text = running and "Farm: ON" or "Farm: OFF"
end)

task.spawn(function()
while true do
if running then
for i = 1, 12 do
if not running then break end

character = getCharacter()
hrp = character:WaitForChild("HumanoidRootPart")

teleportToStage(i)

if i == 12 then
task.wait(1)

local prompt = getNearestPrompt()
if prompt then
cancelHold = false
prompt:InputHoldBegin()

local holdTime = prompt.HoldDuration > 0 and prompt.HoldDuration or 2
local startTime = tick()

while tick() - startTime < holdTime do
if cancelHold or not running then
break
end
RunService.Heartbeat:Wait()
end

prompt:InputHoldEnd()
end

task.wait(2)
else
task.wait(1.2)
end
end
else
task.wait(0.2)
end
end
end)
[ View More ]
2082c9ea-ce92-4c66-a52d-a7ff9d30df52.webp


auto farm the obby for ice!has simple draggable gui with on and off button
 
Back
Top