-- ============================================================ -- Gold Hunters 2 + The Floor Is Lava | one script for both games -- Place in: (Xeno)\autoexec\GoldHunters_AllInOne.lua -- ============================================================ local GOLD_HUNTERS_PLACE_IDS = { [107175140535005] = true, [16415498648] = true } -- 341654025 is the UNIVERSE id (game.GameId) of The Floor Is Lava - NOT a place id. -- Teleporting to it as a place id sends you to a different game, so it is only used to RECOGNISE the game. local LAVA_UNIVERSE_ID = 341654025 -- optional: paste the real PlaceId here (run print(game.PlaceId) inside The Floor Is Lava). -- Leave nil and the script learns it by itself (saved file, or looked up from the universe id). local LAVA_PLACE_ID_OVERRIDE = 815405518 local LAVA_FILE = "FloorIsLava_PlaceId.txt" local TeleportService = game:GetService("TeleportService") local HttpService = game:GetService("HttpService") local isLava = game.GameId == LAVA_UNIVERSE_ID local isGH = GOLD_HUNTERS_PLACE_IDS[game.PlaceId] == true -- real PlaceId of The Floor Is Lava (nil if it can not be found - then we never teleport blindly) local function resolveLavaPlaceId() if LAVA_PLACE_ID_OVERRIDE then return LAVA_PLACE_ID_OVERRIDE end if isLava then return game.PlaceId end if isfile and readfile then local ok, id = pcall(function() if isfile(LAVA_FILE) then return tonumber(readfile(LAVA_FILE)) end end) if ok and id then return id end end local reqf = (syn and syn.request) or http_request or request for _, base in ipairs({ "https://games.roproxy.com/v1/games?universeIds=", "https://games.roblox.com/v1/games?universeIds=" }) do local ok, id = pcall(function() local url = base .. LAVA_UNIVERSE_ID local body if reqf then local r = reqf({ Url = url, Method = "GET" }) body = r and r.Body else body = game:HttpGet(url) end local d = HttpService:JSONDecode(body).data d = d and d[1] if d and d.id == LAVA_UNIVERSE_ID and tonumber(d.rootPlaceId) then return tonumber(d.rootPlaceId) end end) if ok and id then if writefile then pcall(writefile, LAVA_FILE, tostring(id)) end return id end end return nil end -- ONLY two games are allowed: Gold Hunters and The Floor Is Lava. -- Anywhere else -> go to The Floor Is Lava (only with its verified place id). if not isLava and not isGH then local e0 = (getgenv and getgenv()) or _G local token = {} e0.GoldWrongGameToken = token -- running the script again replaces an older run (no silent "already running") task.spawn(function() local t0 = os.clock() while not game:IsLoaded() and os.clock() - t0 < 10 do task.wait(0.2) end local P = game:GetService("Players") while not P.LocalPlayer do task.wait() end local me = P.LocalPlayer -- on-screen notice so you can SEE what it is doing / why a teleport fails local sg = Instance.new("ScreenGui") sg.Name = "GoldWrongGame" sg.ResetOnSpawn = false pcall(function() sg.Parent = (gethui and gethui()) or game:GetService("CoreGui") end) if not sg.Parent then sg.Parent = me:WaitForChild("PlayerGui") end local lbl = Instance.new("TextLabel", sg) lbl.Size = UDim2.new(1, 0, 0, 28) lbl.Position = UDim2.new(0, 0, 0, 40) lbl.BackgroundColor3 = Color3.fromRGB(200, 40, 40) lbl.BackgroundTransparency = 0.2 lbl.BorderSizePixel = 0 lbl.TextColor3 = Color3.new(1, 1, 1) lbl.Font = Enum.Font.GothamBold lbl.TextSize = 16 local function say(t) lbl.Text = t print("[GoldAuto] " .. t) end pcall(function() TeleportService.TeleportInitFailed:Connect(function(_, result, msg) say("Teleport FAILED: " .. tostring(result) .. " | " .. tostring(msg)) end) end) task.wait(1) for attempt = 1, 40 do if e0.GoldWrongGameToken ~= token then return end local id = resolveLavaPlaceId() if not id then say("Wrong game, but Floor Is Lava place id unknown") else say(("Wrong game (place %s) -> Floor Is Lava, try %d"):format(tostring(game.PlaceId), attempt)) -- client-side Teleport only (TeleportAsync is server-only). Each try uses a different -- thread identity, because some executors (Delta) block the call at the default one. local idents = { false, 2, 7, 8, 3 } local ident = idents[(attempt - 1) % #idents + 1] local ok, err = pcall(function() if ident and setthreadidentity then setthreadidentity(ident) end TeleportService:Teleport(id, me) end) if not ok then say("Teleport error (identity " .. tostring(ident) .. "): " .. tostring(err)) end end task.wait(8) end end) return end repeat task.wait() until game:IsLoaded() local env = (getgenv and getgenv()) or _G if env.GoldAllInOneJob == game.JobId then return end -- already running in this server env.GoldAllInOneJob = game.JobId if isLava and writefile then pcall(writefile, LAVA_FILE, tostring(game.PlaceId)) end local AUTO_SMELT_ON_START = true -- Gold Hunters: start the smelt -> Floor Is Lava loop by itself local MAX_DIG_PASSES = 3 -- Floor Is Lava: extra passes while Dig prompts remain -- Gold Hunters Auto FAST: Auto Scan + Auto Dig local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local PPS = game:GetService("ProximityPromptService") local VIM = game:GetService("VirtualInputManager") local lp = Players.LocalPlayer -- speed settings (seconds). Lower = faster, raise if actions stop registering local SCAN_DELAY = 0.5 -- wait after pressing E at a scanner local DIG_MAX_WAIT = 0.7 -- max time to stay after pressing dig (leaves sooner if the prompt vanishes) local DIG_SETTLE = 0.15 -- stay put this long after the prompt vanishes so the dig really registers local FIND_TIMEOUT = 1.2 -- max time to wait for a dig prompt to appear at a beam local DIG_RETRIES = 4 -- presses per prompt before giving up on it (never leaves until done or out of tries) local NUDGE = false -- search around the beam base if no prompt found (slower) local ALLOW_FALLBACK = true -- press other nearby prompts if no "Dig" prompt (never Teleport/Portal) local FALLBACK_RADIUS = 15 local PRESS_COOLDOWN = 2.5 -- never press the same prompt twice within this time (stops double-triggers) local SCAN_MAX_WAIT = 0.8 -- how long to wait for a scan to react before moving on local USE_KEY_BACKUP = false -- real key press as a 2nd attempt (can double-trigger the game's minigame) local SMELT_INTERVAL = 0.3 -- seconds between Smelt presses local SMELT_RANGE = 20 -- only press Smelt prompts this close to you (studs) local autoScan, autoDig = false, false local autoSmelt = AUTO_SMELT_ON_START and not isLava local autoLoop = true -- Floor Is Lava only local busy = false local statusLabel local shown = {} -- prompts currently visible to the player local holdUntil = 0 local function setStatus(t, hold) if hold then holdUntil = os.clock() + hold end if statusLabel then statusLabel.Text = t end end -- ========== helpers ========== local function hrp() local c = lp.Character return c and c:FindFirstChild("HumanoidRootPart") end local function instPos(i) if i:IsA("Model") then return i:GetPivot().Position end if i:IsA("BasePart") then return i.Position end if i:IsA("Attachment") then return i.WorldPosition end local bp = i:FindFirstChildWhichIsA("BasePart", true) return bp and bp.Position end local function promptPos(p) local par = p.Parent if not par then return nil end if par:IsA("Attachment") then return par.WorldPosition end if par:IsA("BasePart") then return par.Position end if par:IsA("Model") then return par:GetPivot().Position end end local function isScanPrompt(p) return p:IsA("ProximityPrompt") and (p.Name == "@SCAN_PROMPT" or (isLava and p.ObjectText == "WGC Gold Hunters")) and p.ActionText == "Scan for Gold Ore" and not p:FindFirstAncestor("Portal") end local function isDigPrompt(p) return p:IsA("ProximityPrompt") and p.ActionText == "Dig" and p.ObjectText == "WGC Gold Hunters" and not p:FindFirstAncestor("Portal") end local function isSafeFallback(p) return p:IsA("ProximityPrompt") and p.ActionText ~= "Teleport" and not p:FindFirstAncestor("Portal") and not isScanPrompt(p) end PPS.PromptShown:Connect(function(p) shown[p] = true end) PPS.PromptHidden:Connect(function(p) shown[p] = nil end) local function tpTo(pos) local r = hrp() if r and pos then r.CFrame = CFrame.new(pos + Vector3.new(0, 3, 0)) end end -- trigger a prompt once. Returns false if it was pressed too recently. -- relax=true also makes the prompt instant / usable from farther away (used for dig + portal only) local lastPress = setmetatable({}, {__mode = "k"}) local function press(p, relax, force) local now = os.clock() if not force and lastPress[p] and now - lastPress[p] < PRESS_COOLDOWN then return false end lastPress[p] = now if relax then pcall(function() p.HoldDuration = 0 p.RequiresLineOfSight = false p.MaxActivationDistance = math.max(p.MaxActivationDistance, 40) end) end if fireproximityprompt then pcall(fireproximityprompt, p) else pcall(function() p:InputHoldBegin(); task.wait(math.max(p.HoldDuration, 0.05) + 0.05); p:InputHoldEnd() end) end return true end -- backup: really press the prompt's key local function keyPress(p) pcall(function() VIM:SendKeyEvent(true, p.KeyboardKeyCode, false, game) task.wait(0.08) VIM:SendKeyEvent(false, p.KeyboardKeyCode, false, game) end) end local function stillActive(p) return p.Parent ~= nil and p.Enabled end -- wait until the character is loaded and alive (after respawn / loading screens) local function waitReady() local t0 = os.clock() while os.clock() - t0 < 10 do local c = lp.Character local h = c and c:FindFirstChildOfClass("Humanoid") if c and c:FindFirstChild("HumanoidRootPart") and h and h.Health > 0 then return true end task.wait(0.25) end return false end local function sortByDistance(list, posOf) local r = hrp() if not r then return end table.sort(list, function(a, b) local pa, pb = posOf(a), posOf(b) if not pa or not pb then return false end return (pa - r.Position).Magnitude < (pb - r.Position).Magnitude end) end -- ========== PORTAL HELPER ========== -- Portals only react when you are close AND the camera is pointed at them, so every attempt -- re-teleports onto the portal, re-aims the camera at it, then presses with a different method. local RunService = game:GetService("RunService") local function aimCameraAt(pos, seconds) local cam = workspace.CurrentCamera if not cam then return end local name = "GHPortalAim" local t0 = os.clock() pcall(function() RunService:UnbindFromRenderStep(name) end) RunService:BindToRenderStep(name, Enum.RenderPriority.Camera.Value + 1, function() if os.clock() - t0 > seconds then RunService:UnbindFromRenderStep(name) return end local look = cam.CFrame.LookVector local flat = Vector3.new(look.X, 0, look.Z) flat = flat.Magnitude > 0.01 and flat.Unit or Vector3.new(0, 0, -1) cam.CFrame = CFrame.lookAt(pos - flat * 10 + Vector3.new(0, 5, 0), pos) end) end -- returns true once the portal prompt is gone (= we got teleported) local function pressPortal(pr, attempts) for attempt = 1, attempts or 8 do if not pr.Parent then return true end if not waitReady() then return false end local pos = promptPos(pr) if pos then tpTo(pos) aimCameraAt(pos, 1.6) end pcall(function() pr.Enabled = true pr.RequiresLineOfSight = false pr.HoldDuration = 0 pr.MaxActivationDistance = math.max(pr.MaxActivationDistance, 40) end) task.wait(0.3) -- let the camera turn and the prompt show press(pr, true, true) task.wait(0.3) if pr.Parent and attempt % 2 == 0 then pcall(function() pr:InputHoldBegin(); task.wait(0.15); pr:InputHoldEnd() end) task.wait(0.2) end -- a real E press triggers whatever prompt is nearest, so only do it when THIS prompt is the one showing if pr.Parent and attempt >= 3 and shown[pr] then keyPress(pr) task.wait(0.3) end task.wait(0.4) end return not pr.Parent end -- replaced further down with the real check (Floor Is Lava only) local goldFull = function() return false end -- ========== AUTO SCAN ========== local function scanRound() local list = {} for _, d in ipairs(workspace:GetDescendants()) do if isScanPrompt(d) and d.Enabled then list[#list + 1] = d end end sortByDistance(list, promptPos) for i, p in ipairs(list) do if not autoScan or goldFull() then break end local pos = promptPos(p) if pos and p.Parent then setStatus(string.format("Scanning %d/%d", i, #list)) if not waitReady() then break end tpTo(pos) task.wait(0.2) if press(p, isLava) then -- let the scan minigame start before leaving local t1 = os.clock() while p.Parent and p.Enabled and os.clock() - t1 < SCAN_MAX_WAIT do task.wait(0.05) end end task.wait(SCAN_DELAY) end end end -- ========== AUTO DIG ========== local BEAM_RETRY = 20 -- seconds before a beam that gave no dig is tried again local visited = setmetatable({}, {__mode = "k"}) -- real dig location of a beam = bottom of its bounding box (the pivot can be high up in the beam) local function beamPos(t) if t:IsA("Model") then local ok, cf, size = pcall(t.GetBoundingBox, t) if ok and cf then return cf.Position - Vector3.new(0, size.Y / 2, 0) end elseif t:IsA("BasePart") then return t.Position - Vector3.new(0, t.Size.Y / 2, 0) end return instPos(t) end local function getBeams() local list = {} for _, c in ipairs(workspace:GetChildren()) do if c.Name == "Location Beam" or c.Name == "Dig Spot" then list[#list + 1] = c end end sortByDistance(list, beamPos) return list end local function groundAt(pos, ignore) local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude local f = {lp.Character} for _, t in ipairs(ignore) do f[#f + 1] = t end params.FilterDescendantsInstances = f -- short ray first (starts near the beam's bottom so roofs above are ignored), long ray as backup local res = workspace:Raycast(pos + Vector3.new(0, 30, 0), Vector3.new(0, -90, 0), params) or workspace:Raycast(pos + Vector3.new(0, 300, 0), Vector3.new(0, -600, 0), params) return res and res.Position or pos end -- look for a prompt near pos: first the visible set (fast), then the beam's own tree, then parts around us local function findPrompt(target, pos, test, radius) for p in pairs(shown) do if p.Parent and p.Enabled and test(p) then local pp = promptPos(p) if pp and (pp - pos).Magnitude <= radius then return p end end end if target then for _, d in ipairs(target:GetDescendants()) do if d:IsA("ProximityPrompt") and d.Enabled and test(d) then return d end end end local ok, parts = pcall(workspace.GetPartBoundsInRadius, workspace, pos, radius, OverlapParams.new()) if ok and parts then for _, part in ipairs(parts) do for _, d in ipairs(part:GetChildren()) do if d:IsA("ProximityPrompt") and d.Enabled and test(d) then return d end for _, dd in ipairs(d:GetChildren()) do if dd:IsA("ProximityPrompt") and dd.Enabled and test(dd) then return dd end end end end end end -- stand exactly on the prompt, press it, confirm it vanished, retry until it is really done. -- Returns true only when the prompt is confirmed gone; never moves on early. local function digPrompt(pr) for attempt = 1, DIG_RETRIES do if not autoDig or not pr.Parent then break end local pp = promptPos(pr) if not pp then break end if not waitReady() then return false end -- (re)stand on it every attempt, in case we got pushed / lagged back tpTo(pp) task.wait(0.05) pcall(function() pr.Enabled = true end) press(pr, true, true) -- forced: we verify the result ourselves, so the cooldown must never skip a press local t1 = os.clock() while stillActive(pr) and os.clock() - t1 < DIG_MAX_WAIT do task.wait(0.03) end if not stillActive(pr) then -- gone: stay a moment so the server registers the dig, then double-check it did not come back task.wait(DIG_SETTLE) if not stillActive(pr) then return true end end -- last attempt: also try a real key press if USE_KEY_BACKUP or attempt == DIG_RETRIES then keyPress(pr) local t2 = os.clock() while stillActive(pr) and os.clock() - t2 < DIG_MAX_WAIT do task.wait(0.03) end if not stillActive(pr) then task.wait(DIG_SETTLE) return true end end end return not stillActive(pr) end local function digRound() -- phase 1: Dig prompts that are already loaded anywhere (most accurate, no guessing) local loaded = {} for _, d in ipairs(workspace:GetDescendants()) do if isDigPrompt(d) and d.Enabled then loaded[#loaded + 1] = d end end sortByDistance(loaded, promptPos) local failed = {} for i, pr in ipairs(loaded) do if not autoDig or goldFull() then return end if not waitReady() then return end setStatus(string.format("Dig prompt %d/%d", i, #loaded)) if not digPrompt(pr) and pr.Parent and pr.Enabled then failed[#failed + 1] = pr end end -- go back to any prompt that did not finish before heading to the beams for round = 1, 2 do if #failed == 0 then break end local again = {} for i, pr in ipairs(failed) do if not autoDig or goldFull() then return end if not waitReady() then return end if pr.Parent and pr.Enabled then setStatus(string.format("Retry dig %d/%d", i, #failed)) if not digPrompt(pr) and pr.Parent and pr.Enabled then again[#again + 1] = pr end end end failed = again end if goldFull() then return end -- phase 2: go to each beam so its dig prompt streams in local beams = getBeams() local now = os.clock() local todo = {} for _, t in ipairs(beams) do if not visited[t] or now - visited[t] > BEAM_RETRY then todo[#todo + 1] = t end end for i, t in ipairs(todo) do if not autoDig or goldFull() then return end if not waitReady() then return end if t.Parent then local bp = beamPos(t) if bp then setStatus(string.format("Beam %d/%d", i, #todo)) local spot = groundAt(bp, beams) tpTo(spot) local pr local t0 = os.clock() repeat pr = findPrompt(t, spot, isDigPrompt, 45) if not pr then task.wait(0.05) end until pr or os.clock() - t0 > FIND_TIMEOUT or not autoDig -- nothing yet: nudge around the beam base in case we landed off to one side if not pr and NUDGE then for _, off in ipairs({Vector3.new(12, 0, 0), Vector3.new(-12, 0, 0), Vector3.new(0, 0, 12), Vector3.new(0, 0, -12)}) do if not autoDig then return end tpTo(groundAt(bp + off, beams)) local t1 = os.clock() repeat pr = findPrompt(t, spot, isDigPrompt, 45) if not pr then task.wait(0.05) end until pr or os.clock() - t1 > 0.4 if pr then break end end end if not pr and ALLOW_FALLBACK and not isLava then pr = findPrompt(t, spot, isSafeFallback, FALLBACK_RADIUS) end if pr then if digPrompt(pr) then visited[t] = os.clock() else visited[t] = os.clock() - BEAM_RETRY + 3 -- not finished: try this beam again in ~3s end else visited[t] = os.clock() end end end end end -- ========== UI ========== local gui = Instance.new("ScreenGui") gui.Name = "GoldAutoFast" gui.ResetOnSpawn = false pcall(function() gui.Parent = (gethui and gethui()) or game:GetService("CoreGui") end) if not gui.Parent then gui.Parent = lp:WaitForChild("PlayerGui") end local main = Instance.new("Frame", gui) main.Size = UDim2.fromOffset(200, 130) main.Position = UDim2.fromOffset(40, 120) main.BackgroundColor3 = Color3.fromRGB(25, 25, 30) main.BorderSizePixel = 0 Instance.new("UICorner", main).CornerRadius = UDim.new(0, 8) local title = Instance.new("TextLabel", main) title.Size = UDim2.new(1, 0, 0, 28) title.BackgroundColor3 = Color3.fromRGB(200, 40, 40) title.BorderSizePixel = 0 title.Text = "Gold Auto FAST (drag)" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.GothamBold title.TextSize = 14 Instance.new("UICorner", title).CornerRadius = UDim.new(0, 8) do local dragging, start, startPos title.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, start, startPos = true, i.Position, main.Position end end) UIS.InputChanged:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - start main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end) UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end local function toggle(text, y, get, set) local b = Instance.new("TextButton", main) b.Size = UDim2.new(1, -16, 0, 30) b.Position = UDim2.new(0, 8, 0, y) b.BorderSizePixel = 0 b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.GothamBold b.TextSize = 14 Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6) local function paint() b.Text = text .. ": " .. (get() and "ON" or "OFF") b.BackgroundColor3 = get() and Color3.fromRGB(40, 130, 60) or Color3.fromRGB(45, 45, 55) end b.MouseButton1Click:Connect(function() set(not get()); paint() end) paint() return paint end local paintScan, paintDig local function paintBoth() paintScan(); paintDig() end paintScan = toggle("Auto Scan", 36, function() return autoScan end, function(v) autoScan = v; if v then autoDig = false; paintBoth() end end) paintDig = toggle("Auto Dig", 72, function() return autoDig end, function(v) autoDig = v; if v then autoScan = false; paintBoth() end end) -- ========== LOBBY PORTAL BUTTON ========== local function isLobbyPortal(p) return p:IsA("ProximityPrompt") and p.ActionText == "Teleport" and string.find(string.lower(p.ObjectText), "gold hunters 2.0", 1, true) ~= nil end local savedPortal PPS.PromptShown:Connect(function(p) if isLobbyPortal(p) then local pp = promptPos(p) if pp then savedPortal = pp end end end) task.spawn(function() for _, d in ipairs(workspace:GetDescendants()) do if isLobbyPortal(d) then local pp = promptPos(d) if pp then savedPortal = pp break end end end end) local goBackToGoldHunters -- defined below local function goLobby() autoScan, autoDig = false, false paintScan() paintDig() setStatus("Going to lobby...", 3) local t0 = os.clock() while busy and os.clock() - t0 < 3 do task.wait(0.1) end if not waitReady() then setStatus("Character not ready", 4) return end local list = {} for _, d in ipairs(workspace:GetDescendants()) do if isLobbyPortal(d) and d.Enabled then list[#list + 1] = d end end sortByDistance(list, promptPos) local pr = list[1] if not pr and savedPortal then setStatus("Flying to portal...", 4) tpTo(savedPortal) local t1 = os.clock() repeat pr = findPrompt(nil, savedPortal, isLobbyPortal, 60) if not pr then task.wait(0.1) end until pr or os.clock() - t1 > 4 end if not pr then setStatus(savedPortal and "Portal not loading" or "Stand at the portal once", 5) return end setStatus("Entering portal...", 5) pressPortal(pr) setStatus("Portal pressed", 3) end local lobbyBtn = Instance.new("TextButton", main) lobbyBtn.Size = UDim2.new(1, -16, 0, 30) lobbyBtn.Position = UDim2.new(0, 8, 0, 108) lobbyBtn.BackgroundColor3 = Color3.fromRGB(60, 90, 170) lobbyBtn.BorderSizePixel = 0 lobbyBtn.Text = "Go to Lobby" lobbyBtn.TextColor3 = Color3.new(1, 1, 1) lobbyBtn.Font = Enum.Font.GothamBold lobbyBtn.TextSize = 14 Instance.new("UICorner", lobbyBtn).CornerRadius = UDim.new(0, 6) lobbyBtn.MouseButton1Click:Connect(function() if isLava then task.spawn(goBackToGoldHunters) else task.spawn(goLobby) end end) if isLava then toggle("Auto Loop", 154, function() return autoLoop end, function(v) autoLoop = v if not v then autoScan, autoDig = false, false; paintScan(); paintDig() end end) lobbyBtn.Text = "Go to Gold Hunters" else toggle("Auto Smelt", 154, function() return autoSmelt end, function(v) autoSmelt = v end) end main.Size = UDim2.fromOffset(200, 214) statusLabel = Instance.new("TextLabel", main) statusLabel.Position = UDim2.new(0, 8, 0, 192) statusLabel.Size = UDim2.new(1, -16, 0, 16) statusLabel.BackgroundTransparency = 1 statusLabel.TextColor3 = Color3.fromRGB(180, 180, 190) statusLabel.Font = Enum.Font.Gotham statusLabel.TextSize = 12 statusLabel.Text = "Idle" -- ========== AUTO SMELT ========== local function isSmeltPrompt(p) return p:IsA("ProximityPrompt") and p.ActionText == "Smelt" end -- ONLY "The Floor Is LAVA" - never "The Ground is LAVA" or any other lava game local function isLavaGamePortal(p) if not (p:IsA("ProximityPrompt") and p.ActionText == "Teleport") then return false end local t = string.lower(p.ObjectText or "") return string.find(t, "floor is lava", 1, true) ~= nil and string.find(t, "ground", 1, true) == nil end local smeltBusy = false local failedSmelt = setmetatable({}, {__mode = "k"}) -- prompts that did not work this round -- nearest Smelt prompt that has not failed yet (enabled ones first) local function findSmeltPrompt() local all, fresh = {}, {} for _, d in ipairs(workspace:GetDescendants()) do if isSmeltPrompt(d) then all[#all + 1] = d if not failedSmelt[d] then fresh[#fresh + 1] = d end end end if #fresh == 0 then -- every one failed: start over table.clear(failedSmelt) fresh = all end sortByDistance(fresh, promptPos) for _, d in ipairs(fresh) do if d.Enabled then return d end end return fresh[1] end local function findLavaPortal() for p in pairs(shown) do if p.Parent and p.Enabled and isLavaGamePortal(p) then return p end end for _, d in ipairs(workspace:GetDescendants()) do if isLavaGamePortal(d) and d.Enabled then return d end end return nil end local function teleportLavaDirect() local id = resolveLavaPlaceId() if not id then setStatus("Lava place id unknown (see top of script)", 6) return false end setStatus("Teleporting to Floor Is Lava...", 6) pcall(function() TeleportService:Teleport(id, lp) end) return true end local function goLavaGame() if isLava then return end setStatus("Finding Lava portal...", 3) local pr local t0 = os.clock() repeat pr = findLavaPortal() -- only a Teleport prompt whose text says LAVA, never any other portal if not pr then task.wait(0.2) end until pr or os.clock() - t0 > 2 if pr then setStatus("Entering Lava portal...", 5) pressPortal(pr, 6) task.wait(8) -- if the teleport worked this script stops here (new server) end -- portal missing or did not work: teleport by place id so we never land in another game for _ = 1, 3 do if not teleportLavaDirect() then break end task.wait(8) end end -- GUIs that sit on top of the Smelt prompt (menus, overlays...) swallow the press. -- Find every ScreenGui covering the prompt (or the screen centre) and hide it while we press. local function hideBlockingGuis(prompt) local hidden = {} local pg = lp:FindFirstChildOfClass("PlayerGui") local cam = workspace.CurrentCamera if not pg or not cam then return hidden end local points = { cam.ViewportSize / 2 } local pos = promptPos(prompt) if pos then local v, onScreen = cam:WorldToViewportPoint(pos) if onScreen then points[#points + 1] = Vector2.new(v.X, v.Y) end end for _, pt in ipairs(points) do local ok, objs = pcall(function() return pg:GetGuiObjectsAtPosition(pt.X, pt.Y) end) if ok then for _, o in ipairs(objs) do local sg = o:FindFirstAncestorOfClass("ScreenGui") if sg and sg ~= gui and sg.Enabled and not gui:IsAncestorOf(sg) and not string.find(string.lower(sg.Name), "prompt", 1, true) then sg.Enabled = false hidden[#hidden + 1] = sg end end end end return hidden end local function restoreGuis(list) for _, sg in ipairs(list) do if sg.Parent then sg.Enabled = true end end end -- "Like 'Gold Hunters 2' to earn Gold Bars / Let's GO!" and similar pop-ups: hide them for good local POPUP_TEXTS = { "let's go", "lets go", "like the game", "like 'gold hunters", "join the group", "earn gold bars", "extra gold bars" } local function isPopupText(t) t = string.lower(t or "") t = string.gsub(t, "<[^>]->", "") t = string.gsub(t, "\226\128\152", "'") -- curly quotes -> ' t = string.gsub(t, "\226\128\153", "'") for _, key in ipairs(POPUP_TEXTS) do if string.find(t, key, 1, true) then return true end end return false end local CLICK_POPUP = true -- press "Let's GO!" so the game closes the pop-up itself (false = only hide it) local function clickButton(b) if not getconnections then return false end local did = false for _, sig in ipairs({ "Activated", "MouseButton1Click", "MouseButton1Down", "MouseButton1Up" }) do pcall(function() for _, c in ipairs(getconnections(b[sig])) do pcall(function() c:Fire() end) did = true end end) end return did end local POPUP_RECLICK = 5 -- seconds before the same pop-up button may be clicked again local popupClicked = setmetatable({}, {__mode = "k"}) local GuiService = game:GetService("GuiService") -- visible on screen = itself and every parent are visible, and its ScreenGui is on local function isReallyVisible(o) local cur = o while cur do if cur:IsA("GuiObject") and not cur.Visible then return false end if cur:IsA("ScreenGui") then return cur.Enabled end cur = cur.Parent end return false end -- real mouse click on the middle of a button (works when firing its connections does nothing) local function mouseClick(b) pcall(function() local inset = GuiService:GetGuiInset() local x = b.AbsolutePosition.X + b.AbsoluteSize.X / 2 + inset.X local y = b.AbsolutePosition.Y + b.AbsoluteSize.Y / 2 + inset.Y VIM:SendMouseButtonEvent(x, y, 0, true, game, 0) task.wait(0.08) VIM:SendMouseButtonEvent(x, y, 0, false, game, 0) end) end -- press a pop-up button so the game runs its own close logic local function pushButton(b) if not isReallyVisible(b) then return end clickButton(b) task.wait(0.4) if b.Parent and isReallyVisible(b) then mouseClick(b) task.wait(0.4) end end local CLOSE_TEXTS = { ["x"] = true, ["\195\151"] = true, ["\226\156\149"] = true, ["\226\156\150"] = true, ["close"] = true, ["no thanks"] = true, ["maybe later"] = true, ["let's go"] = true, ["let's go!"] = true } local CLOSE_NAMES = { ["x"] = true, ["close"] = true, ["closebutton"] = true, ["closebtn"] = true, ["exit"] = true, ["exitbutton"] = true } -- find the X / Close button inside a pop-up panel local function findCloseButton(root) local list = root:GetDescendants() list[#list + 1] = root for _, d in ipairs(list) do if d:IsA("GuiButton") and isReallyVisible(d) then if CLOSE_NAMES[string.lower(d.Name)] then return d end local texts = d:GetDescendants() texts[#texts + 1] = d for _, t in ipairs(texts) do if t:IsA("TextButton") or t:IsA("TextLabel") then local text = string.gsub(string.lower(t.Text), "<[^>]->", "") text = string.gsub(text, "^%s*(.-)%s*$", "%1") if CLOSE_TEXTS[text] then return d end end end end end end local function dismissPopups() local pg = lp:FindFirstChildOfClass("PlayerGui") local cam = workspace.CurrentCamera if not pg then return end local vs = cam and cam.ViewportSize or Vector2.new(1280, 720) for _, d in ipairs(pg:GetDescendants()) do if (d:IsA("TextLabel") or d:IsA("TextButton")) and d.Visible and isPopupText(d.Text) and not gui:IsAncestorOf(d) then local sg = d:FindFirstAncestorOfClass("ScreenGui") if sg and sg.Enabled and sg ~= gui then -- 1) try the real button first so the game's own close logic runs local btn = d:IsA("TextButton") and d or d:FindFirstAncestorWhichIsA("GuiButton") if CLICK_POPUP and btn and isReallyVisible(d) and (not popupClicked[btn] or os.clock() - popupClicked[btn] > POPUP_RECLICK) then popupClicked[btn] = os.clock() local text = string.lower(d.Text) if string.find(text, "let's go", 1, true) or string.find(text, "lets go", 1, true) then pushButton(btn) else clickButton(btn) task.wait(0.5) end print("Clicked pop-up button: " .. btn:GetFullName()) end -- 2) still there? hide the biggest panel around it if d.Parent and d.Visible and sg.Enabled then local panel, cur = nil, d while cur and cur ~= sg do if cur:IsA("GuiObject") then if cur.AbsoluteSize.X >= vs.X * 0.6 and cur.AbsoluteSize.Y >= vs.Y * 0.6 then panel = cur end if not panel then panel = cur.Parent == sg and cur or panel end end cur = cur.Parent end if panel and panel:IsA("GuiObject") then panel.Visible = false else sg.Enabled = false end print("Hid pop-up: " .. d:GetFullName()) end end end end end -- generic: hide any big visible panel (not ours, not a prompt UI) that sits on the screen centre -- or on top of the given prompt, whatever it says. Hidden panels stay hidden. local function killBlockers(prompt) local pg = lp:FindFirstChildOfClass("PlayerGui") local cam = workspace.CurrentCamera if not pg or not cam then return end local vs = cam.ViewportSize local pts = { vs / 2 } local pos = prompt and promptPos(prompt) if pos then local v, on = cam:WorldToViewportPoint(pos) if on then pts[#pts + 1] = Vector2.new(v.X, v.Y) end end for _, pt in ipairs(pts) do local ok, objs = pcall(function() return pg:GetGuiObjectsAtPosition(pt.X, pt.Y) end) if ok then for _, o in ipairs(objs) do local sg = o:FindFirstAncestorOfClass("ScreenGui") if sg and sg ~= gui and not gui:IsAncestorOf(o) and not string.find(string.lower(sg.Name), "prompt", 1, true) then -- the top-level panel this object belongs to local root = o while root.Parent and root.Parent ~= sg do root = root.Parent end local solid = root:IsA("GuiObject") and (root.Active or root:IsA("GuiButton") or root.BackgroundTransparency < 0.95 or root:IsA("ImageLabel") or root:IsA("ImageButton") or o:IsA("TextButton") or o:IsA("ImageButton")) if root:IsA("GuiObject") and root.Visible and solid then local close = findCloseButton(root) if close then pushButton(close) end if root.Parent and root.Visible then root.Visible = false print("Hid blocking GUI: " .. root:GetFullName() .. " (via " .. o:GetFullName() .. ")") end end end end end end end -- print everything about the smelt prompt so a failure can be diagnosed (open the console with F9) local function dumpSmeltInfo(p, origEnabled, origHold) local r, pos = hrp(), promptPos(p) print("---- SMELT DEBUG ----") print("prompt:", p:GetFullName()) print("ActionText:", p.ActionText, "| ObjectText:", p.ObjectText) print("Enabled (originally):", origEnabled, "| HoldDuration (originally):", origHold) print("MaxActivationDistance:", p.MaxActivationDistance, "| Style:", tostring(p.Style), "| Exclusivity:", tostring(p.Exclusivity)) print("distance to prompt:", (r and pos) and math.floor((r.Position - pos).Magnitude * 10) / 10 or "?") print("currently shown to player:", shown[p] == true) local pg = lp:FindFirstChildOfClass("PlayerGui") local cam = workspace.CurrentCamera if pg and cam and pos then local v, on = cam:WorldToViewportPoint(pos) print("prompt on screen:", on) local ok, objs = pcall(function() return pg:GetGuiObjectsAtPosition(v.X, v.Y) end) if ok then for _, o in ipairs(objs) do print(" GUI over prompt:", o:GetFullName()) end end end print("---------------------") end -- Gold Ore number from the HUD: the real proof that smelting happened local function readOre() local node = lp:FindFirstChildOfClass("PlayerGui") for _, name in ipairs({ "HUD", "GoldCounters", "GoldOreCounter", "Counter" }) do node = node and node:FindFirstChild(name) end if not node then return nil end local text = string.gsub(node.Text, "<[^>]->", "") text = string.gsub(text, ",", "") return tonumber(string.match(text, "%d+")) end -- the clickable button inside the game's own "Smelt" prompt local function findPromptButton() local pg = lp:FindFirstChildOfClass("PlayerGui") local screen = pg and pg:FindFirstChild("ProximityPrompts") for _, d in ipairs(screen and screen:GetDescendants() or {}) do if d.Name == "ActionText" and d:IsA("TextLabel") and d.Text == "Smelt" then local frame = d.Parent and d.Parent.Parent local button = frame and frame.Parent and frame.Parent:FindFirstChildOfClass("TextButton") if button then return button end end end end local smeltLog = {} -- result of every method in the last smelt try -- everything needed to see what blocks smelting: saved to a file and copied to the clipboard local function smeltReport(reason) local out = {} local function add(...) local t = {} for i = 1, select("#", ...) do t[#t + 1] = tostring((select(i, ...))) end out[#out + 1] = table.concat(t, " ") end local function try(f) local ok, v = pcall(f) return ok and v or "?" end add("SMELT REPORT:", reason, "| place", game.PlaceId) add("fireproximityprompt:", fireproximityprompt ~= nil, "| getconnections:", getconnections ~= nil) add("PromptService enabled:", try(function() return tostring(PPS.Enabled) end)) add("focused textbox:", try(function() local b = UIS:GetFocusedTextBox() return b and b:GetFullName() or "none" end)) add("gold ore:", try(function() return tostring(readOre()) end)) add("-- last smelt try --") for _, line in ipairs(smeltLog) do add(line) end add("-- smelt prompts --") for _, d in ipairs(workspace:GetDescendants()) do if isSmeltPrompt(d) then local r, pos = hrp(), promptPos(d) add(d:GetFullName(), "| enabled", d.Enabled, "| hold", d.HoldDuration, "| key", d.KeyboardKeyCode, "| style", d.Style, "| range", d.MaxActivationDistance, "| distance", (r and pos) and math.floor((r.Position - pos).Magnitude) or "?", "| shown", shown[d] == true) end end add("-- visible GUI text and buttons --") local pg = lp:FindFirstChildOfClass("PlayerGui") local count = 0 for _, d in ipairs(pg and pg:GetDescendants() or {}) do if count >= 250 then break end local isText = d:IsA("TextLabel") or d:IsA("TextButton") or d:IsA("TextBox") if (isText or d:IsA("ImageButton")) and not gui:IsAncestorOf(d) then local visible, cur = true, d while cur and cur ~= pg do if cur:IsA("GuiObject") and not cur.Visible then visible = false break end if cur:IsA("ScreenGui") and not cur.Enabled then visible = false break end cur = cur.Parent end if visible then count = count + 1 add(d.ClassName, d:GetFullName(), isText and ('| "' .. d.Text .. '"') or "") end end end local text = table.concat(out, "\n") print(text) local saved = writefile ~= nil and pcall(writefile, "GoldHunters_smelt_report.txt", text) local copied = setclipboard ~= nil and pcall(setclipboard, text) return saved, copied end -- Auto Smelt = stand on the Smelt prompt and press E (held as long as the prompt asks for) local function triggerSmelt(p) table.clear(smeltLog) local oreBefore = readOre() if oreBefore == 0 then smeltLog[1] = "no gold ore to smelt" setStatus("No ore to smelt", 3) return true end local fired, triggered = false, false local conn = p.Triggered:Connect(function() triggered = true end) local wasEnabled, origHold = p.Enabled, p.HoldDuration -- success = the ore number goes down. Only if it can't be read: the prompt fired or closed. local function check(method) local t = os.clock() local limit = oreBefore and 2.5 or 0.8 while not fired and os.clock() - t < limit do if oreBefore then local ore = readOre() if ore and ore < oreBefore then fired = true end elseif triggered or (wasEnabled and (not p.Parent or not p.Enabled)) then fired = true end task.wait(0.05) end local line = method .. " | triggered " .. tostring(triggered) .. " | ore " .. tostring(oreBefore) .. " -> " .. tostring(readOre()) .. " | " .. (fired and "WORKED" or "failed") smeltLog[#smeltLog + 1] = line print("Smelt: " .. line) triggered = false end local function canTry() return not fired and autoSmelt and p.Parent ~= nil end local methods = { { "E key", function() local key = p.KeyboardKeyCode VIM:SendKeyEvent(true, key, false, game) task.wait(origHold + 0.3) VIM:SendKeyEvent(false, key, false, game) end }, { "direct trigger", function() press(p, true, true) p.HoldDuration = origHold end }, { "hold input", function() p:InputHoldBegin() task.wait(origHold + 0.3) p:InputHoldEnd() end }, { "prompt button", function() local button = findPromptButton() if button then pushButton(button) end end }, } for attempt = 1, 3 do if not canTry() then break end if not waitReady() then break end local pos = promptPos(p) if pos then tpTo(pos) aimCameraAt(pos, 2) end -- a pop-up may switch prompts off or leave a text box focused: undo that pcall(function() PPS.Enabled = true end) pcall(function() p.Enabled = true; p.RequiresLineOfSight = false end) pcall(function() local box = UIS:GetFocusedTextBox() if box then box:ReleaseFocus() end end) pcall(dismissPopups) pcall(killBlockers, p) task.wait(0.15) -- wait until the prompt is really showing local t0 = os.clock() while not shown[p] and os.clock() - t0 < 1.5 do task.wait(0.05) end task.wait(0.2) for _, m in ipairs(methods) do if not canTry() then break end setStatus("Smelt: " .. m[1] .. " (" .. attempt .. "/3)", 4) pcall(m[2]) check(m[1]) end end conn:Disconnect() if not fired and autoSmelt then setStatus("Smelt failed - send report", 6) pcall(dumpSmeltInfo, p, wasEnabled, origHold) pcall(smeltReport, "all methods failed on " .. p:GetFullName()) end return fired end if not isLava then main.Size = UDim2.fromOffset(200, 250) local reportBtn = Instance.new("TextButton", main) reportBtn.Size = UDim2.new(1, -16, 0, 30) reportBtn.Position = UDim2.new(0, 8, 0, 212) reportBtn.BackgroundColor3 = Color3.fromRGB(150, 100, 30) reportBtn.BorderSizePixel = 0 reportBtn.Text = "Copy Smelt Report" reportBtn.TextColor3 = Color3.new(1, 1, 1) reportBtn.Font = Enum.Font.GothamBold reportBtn.TextSize = 14 Instance.new("UICorner", reportBtn).CornerRadius = UDim.new(0, 6) reportBtn.MouseButton1Click:Connect(function() local ok, saved, copied = pcall(smeltReport, "button pressed") if ok and copied then setStatus("Report copied", 5) elseif ok and saved then setStatus("Report saved to file", 5) else setStatus("Report: check F9", 5) end end) end task.spawn(function() while gui.Parent do if autoSmelt and not smeltBusy then smeltBusy = true pcall(dismissPopups) -- 1) find the smelt prompt local target = findSmeltPrompt() if target then -- 2) teleport to it and let the prompt appear local pp = promptPos(target) if pp then tpTo(pp) task.wait(1) end -- 3) press smelt if triggerSmelt(target) then table.clear(failedSmelt) -- 4) wait 20 seconds for the smelt to finish for left = 20, 1, -1 do if not autoSmelt then break end setStatus("Smelting... (" .. left .. "s)", 2) task.wait(1) end -- 5) go to the Floor Is Lava game if autoSmelt then goLavaGame() end else failedSmelt[target] = true setStatus("Smelt did not trigger, retrying", 3) task.wait(2) end else setStatus("No smelt prompt found", 2) task.wait(2) end smeltBusy = false end task.wait(0.5) end end) -- ========== FLOOR IS LAVA: SCAN <-> DIG LOOP ========== -- gold counter: any "@COUNT" label (or label inside "Currency Bar") reading X/30 local GOLD_MAX = 30 local goldSource local function readGold(label) if not label:IsA("TextLabel") then return nil end if label.Name ~= "@COUNT" and not label:FindFirstAncestor("Currency Bar") then return nil end local text = string.gsub(label.Text, "<[^>]->", "") -- strip rich text tags local cur, max = string.match(text, "(%d+)%s*/%s*(%d+)") if tonumber(max) == GOLD_MAX then return tonumber(cur) end end local function getGold() if goldSource and goldSource:IsDescendantOf(game) then local cur = readGold(goldSource) if cur then return cur end end for _, root in ipairs({lp:FindFirstChild("PlayerGui"), workspace}) do for _, d in ipairs(root:GetDescendants()) do local cur = readGold(d) if cur then goldSource = d print("FloorIsLava gold read from:", d:GetFullName()) return cur end end end return nil end local function isFull() local cur = getGold() return cur ~= nil and cur >= GOLD_MAX end function goBackToGoldHunters() local function find() for _, d in ipairs(workspace:GetDescendants()) do if d:IsA("ProximityPrompt") and d.Enabled and d.ActionText == "Teleport" and string.find(string.lower(d.ObjectText), "gold hunters", 1, true) then return d end end end setStatus("Finding GH portal...", 3) local pr = find() local t0 = os.clock() while not pr and os.clock() - t0 < 5 do task.wait(0.2) pr = find() end if not pr then setStatus("GH portal not found!", 4) return end setStatus("Entering GH portal...", 5) pressPortal(pr) setStatus("Back to Gold Hunters!", 3) end goldFull = function() return isLava and autoLoop and isFull() end local function setMode(scan, dig) autoScan, autoDig = scan, dig paintScan() paintDig() end local function hasDigPrompt() for _, d in ipairs(workspace:GetDescendants()) do if isDigPrompt(d) and d.Enabled then return true end end return false end local function hasWork(mode) if mode == "dig" then return hasDigPrompt() or #getBeams() > 0 end for _, d in ipairs(workspace:GetDescendants()) do if isScanPrompt(d) and d.Enabled then return true end end return false end local function lavaLoop() task.wait(3) -- let the game stream in -- stop scanning/digging as soon as the gold is full task.spawn(function() while gui.Parent do local cur = getGold() title.Text = "Gold: " .. (cur and (cur .. "/" .. GOLD_MAX) or "not found") if autoLoop and cur and cur >= GOLD_MAX then setMode(false, false) end task.wait(0.5) end end) local mode, passes = "scan", 0 while gui.Parent do if not autoLoop then -- loop off: the Auto Scan / Auto Dig buttons work by hand if autoScan then pcall(scanRound) elseif autoDig then pcall(digRound) end task.wait(0.5) elseif isFull() then setMode(false, false) goBackToGoldHunters() task.wait(5) elseif waitReady() and not hasWork(mode) then setMode(false, false) setStatus("Nothing to " .. mode .. ", waiting...", 3) task.wait(3) mode, passes = (mode == "scan") and "dig" or "scan", 0 elseif waitReady() then setMode(mode == "scan", mode == "dig") local ok, err = pcall(mode == "scan" and scanRound or digRound) if not ok then setStatus("Loop error", 3) warn(err) end -- short pause so the modes never flip rapidly; none when full, leave right away if not isFull() then task.wait(0.5) end if mode == "scan" then -- every scanner visited: now dig mode, passes = "dig", 0 table.clear(visited) else passes = passes + 1 if not hasDigPrompt() or passes >= MAX_DIG_PASSES then mode = "scan" end end end task.wait(0.2) end end -- ========== main loop ========== task.spawn(function() if isLava then return lavaLoop() end while gui.Parent do if autoScan and not busy then busy = true local ok, err = pcall(scanRound) if not ok then setStatus("Scan error") warn(err) end busy = false end if autoDig and not busy then busy = true local ok, err = pcall(digRound) if not ok then setStatus("Dig error") warn(err) end busy = false end if not autoScan and not autoDig and os.clock() > holdUntil then setStatus("Idle") end task.wait(0.1) end end) UIS.InputBegan:Connect(function(i, gp) if not gp and i.KeyCode == Enum.KeyCode.RightShift then main.Visible = not main.Visible end end)