Home » Roblox Scripts » 4 Powerful Scripts for Treasure Hunt Simulator

4 Powerful Scripts for Treasure Hunt Simulator

Photo of author
Published on

If you are looking for the best scripts to enhance your gameplay in Treasure Hunt Simulator, then you are in the right place. These scripts provide useful features like auto farming, auto rebirth, X-ray vision, and more. Below are some of the best scripts available for this game.

01 Auto Farm – Treasure Hunt Simulator

FeatureDescription
X-RaySee through objects to find treasures easily
ESP PlayerLocate other players in the game
Auto Farm AIAutomatically digs and collects treasures

Script:

---------- [ Library ] ----------
local Library = loadstring(game:HttpGet("https://pastebin.com/raw/b5QLVFiM"))()

---------- [ Window ] ----------
local Window = Library:CreateWindow('JustShare - Hub')

---------- [ Create Tab ] ----------
local Tab = {
    Home = Window:addTab('•Home + Settings'),
    ESP = Window:addTab('•Esp'),
}

---------- [ Home Tab Section ] ----------
local Home_Right = Tab.Home:addSection()
local Main_Home = Home_Right:addMenu("#Home")

---------- [ Variables ] ----------
local Farm = false
local Rebirth = false
local IsSelling = false
local AutoFarmAI = false
local ESPEnabled = false
local FarmPaused = false
local XRayEnabled = false
local AutoSellEnabled = false
local ESPPlayerEnabled = false
local VisualEffectsEnabled = true
local CurrentChest = nil
local FarmingSpeed = 0.001  -- Mengatur farming speed menjadi 0.001
local PathfindingService = game:GetService("PathfindingService")
local UserInputService = game:GetService("UserInputService")
local VirtualInputManager = game:GetService("VirtualInputManager")
local XRayTransparency = 0.2
local PlayerHighlights = {}
local ChestHighlights = {}

---------- [ Sell Function ] ----------
local function Sell()
    if IsSelling then return end
    IsSelling = true

    local OldPos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
    game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(3, 10, -160)
    wait(0.1)
    game.ReplicatedStorage.Events.AreaSell:FireServer()
    wait(0.1)

    game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = OldPos
    game:GetService("StarterGui"):SetCore("SendNotification", {
        Title = "Success!",
        Text = "Sand sold successfully!",
        Duration = 5,
    })

    IsSelling = false
end

---------- [ Auto Farm Loop ] ----------
local function AutoFarmLoop()
    while Farm do
        if FarmPaused then
            wait(0.1)
        else
            -- Memastikan tool ada di tangan
            local tool = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool") or 
                         game.Players.LocalPlayer.Backpack:FindFirstChildOfClass("Tool")

            -- Pastikan tool tersedia sebelum melanjutkan
            if not tool then
                game:GetService("StarterGui"):SetCore("SendNotification", {
                    Title = "Error!",
                    Text = "No tool found! Disabling Auto Farm.",
                    Duration = 5,
                })
                Farm = false
                return
            elseif not game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool") then
                game.Players.LocalPlayer.Character.Humanoid:EquipTool(tool)
                wait(0.1)
            end

            -- Fokuskan posisi karakter hanya pada chest yang sedang di-farm
            if CurrentChest and CurrentChest.Parent then
                local humanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
                local targetPosition = CurrentChest.Position

                -- Pindahkan karakter ke chest dengan kecepatan lebih tinggi
                if (humanoidRootPart.Position - targetPosition).Magnitude > 0.5 then
                    humanoidRootPart.CFrame = CFrame.new(targetPosition)
                end

                tool.RemoteClick:FireServer(CurrentChest)
                wait(FarmingSpeed)

                -- Cek apakah Backpack penuh dan jual otomatis jika perlu
                if AutoSellEnabled and game.Players.LocalPlayer.PlayerGui.Gui.Popups.BackpackFull.Visible then
                    FarmPaused = true
                    Sell()
                    FarmPaused = false
                end
            else
                -- Jika Chest tidak ditemukan, lakukan pencarian chest baru
                CurrentChest = nil
                for _, v in pairs(game.Workspace.SandBlocks:GetChildren()) do
                    if not Farm then break end
                    if v:FindFirstChild("Chest") then
                        CurrentChest = v
                        v.CanCollide = false
                        local character = game.Players.LocalPlayer.Character
                        if character then
                            -- Fokuskan posisi karakter pada chest baru
                            local humanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
                            local targetPosition = v.Position
                            
                            -- Pindahkan posisi karakter hanya jika diperlukan
                            if (humanoidRootPart.Position - targetPosition).Magnitude > 0.5 then
                                humanoidRootPart.CFrame = CFrame.new(targetPosition)
                            end

                            tool.RemoteClick:FireServer(v)
                            wait(0.05)
                        end
                        break
                    end
                end
            end
        end
        wait(0.05) 
    end
end

---------- [ Toggling Features ] ----------
-- Auto Farm Toggle
Main_Home:addToggle('Auto Farm', false, function(state)
    Farm = state
    if state then
        -- Cek apakah tool sudah ada di karakter
        local tool = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
        if not tool then
            tool = game.Players.LocalPlayer.Backpack:FindFirstChildOfClass("Tool")
        end
        
        if not tool then
            game:GetService("StarterGui"):SetCore("SendNotification", {
                Title = "Error!",
                Text = "No tool found! Auto Farm disabled.",
                Duration = 5,
            })
            Farm = false
            return
        end

        if not game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool") then
            game.Players.LocalPlayer.Character.Humanoid:EquipTool(tool)
            wait(0.1)
        end

        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Success!",
            Text = "Auto Farm enabled.",
            Duration = 5,
        })
        spawn(AutoFarmLoop)
    else
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Info!",
            Text = "Auto Farm disabled.",
            Duration = 5,
        })
    end
end)

---- Function Move
local function MoveToPosition(targetPosition)
    local player = game.Players.LocalPlayer
    local character = player.Character
    if not character or not character:FindFirstChild("HumanoidRootPart") then return end

    local rootPart = character.HumanoidRootPart
    local humanoid = character:FindFirstChildOfClass("Humanoid")

    -- Hitung perbedaan posisi
    local direction = (targetPosition - rootPart.Position).unit
    local distance = (targetPosition - rootPart.Position).Magnitude

    -- Jika jarak cukup jauh, gerakkan karakter maju (W)
    if distance > 3 then
        -- Gerakkan maju (W)
        VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.W, false, game)
    else
        -- Jika jarak dekat (sudah di atas sand), hentikan pergerakan
        VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.W, false, game)

        -- Gali atau ambil chest
        local tool = character:FindFirstChildOfClass("Tool") or player.Backpack:FindFirstChildOfClass("Tool")
        if tool then
            tool.RemoteClick:FireServer(targetPosition)
        end
    end
end

---------- [ Auto Farming AI Function ] ----------
local function AutoFarmAILoop()
    while AutoFarmAI do
        local player = game.Players.LocalPlayer
        local character = player.Character
        if not character or not character:FindFirstChild("HumanoidRootPart") then
            wait(1)
            continue
        end

        local rootPart = character.HumanoidRootPart
        local tool = character:FindFirstChildOfClass("Tool") or player.Backpack:FindFirstChildOfClass("Tool")

        if not tool then
            game:GetService("StarterGui"):SetCore("SendNotification", {
                Title = "Error!",
                Text = "No tool found! Auto Farm AI disabled.",
                Duration = 5,
            })
            AutoFarmAI = false
            return
        end

        -- Cari pasir atau chest terdekat
        local nearestSand, nearestChest
        local shortestDistance = math.huge

        for _, block in pairs(game.Workspace.SandBlocks:GetChildren()) do
            if not block:IsA("BasePart") then continue end

            local distance = (block.Position - rootPart.Position).Magnitude
            if distance < shortestDistance then
                nearestSand = block
                shortestDistance = distance
            end

            if block:FindFirstChild("Chest") then
                nearestChest = block
            end
        end

        -- Prioritaskan chest jika ditemukan
        if nearestChest then
            nearestSand = nearestChest
        end

        -- Jika sand atau chest ditemukan, bergerak menuju target
        if nearestSand then
            MoveToPosition(nearestSand.Position)  -- Gunakan MoveToPosition untuk pergerakan
            wait(FarmingSpeed)  -- Tunggu untuk melakukan aksi farming
        end

        -- Cek apakah Backpack penuh dan jual otomatis jika perlu
        if AutoSellEnabled and IsBackpackFull() then
            FarmPaused = true
            Sell()  -- Panggil fungsi Sell jika Backpack penuh
            FarmPaused = false
        end

        wait(0.1)  -- Tunggu sebentar sebelum melanjutkan ke iterasi berikutnya
    end
end

---------- [ Toggle for Auto Farm AI ] ----------
Main_Home:addToggle('Auto Farm With AI', false, function(state)
    AutoFarmAI = state
    if AutoFarmAI then
        -- Memastikan HumanoidRootPart tidak di-anchored
        local character = game.Players.LocalPlayer.Character
        if character then
            local humanoid = character:FindFirstChildOfClass("Humanoid")
            if humanoid then
                humanoid.PlatformStand = false  -- Pastikan PlatformStand di-nonaktifkan
            end
        end

        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Auto Farm AI Enabled",
            Text = "Auto Farm AI is now active.",
            Duration = 5,
        })
        -- Menjalankan loop AI AutoFarm
        task.spawn(AutoFarmAILoop)  -- Pastikan loop dimulai dengan benar
    else
        -- Mengembalikan kontrol manual karakter
        local character = game.Players.LocalPlayer.Character
        if character then
            local humanoid = character:FindFirstChildOfClass("Humanoid")
            if humanoid then
                humanoid.PlatformStand = false  -- Pastikan PlatformStand di-nonaktifkan saat toggle off
            end
        end

        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Auto Farm AI Disabled",
            Text = "Auto Farm AI is now disabled.",
            Duration = 5,
        })
    end
end)

-- Auto Sell Toggle
Main_Home:addToggle('Auto Sell', false, function(state)
    AutoSellEnabled = state
    game:GetService("StarterGui"):SetCore("SendNotification", {
        Title = state and "Enabled!" or "Disabled!",
        Text = "Auto Sell " .. (state and "enabled." or "disabled."),
        Duration = 5,
    })
end)

---------- [ X-Ray ] ----------
-- Fungsi rekursif untuk mengubah transparansi semua objek
local function SetTransparencyRecursive(object)
    -- Cek jika objek adalah BasePart dan belum diubah transparansinya
    if object:IsA("BasePart") and object.Transparency ~= XRayTransparency then
        object.Transparency = XRayTransparency
    end

    -- Periksa anak objek untuk objek-objek lebih dalam
    for _, child in pairs(object:GetChildren()) do
        SetTransparencyRecursive(child)
    end
end

-- Fungsi untuk mengaktifkan X-Ray
local function EnableXRay()
    SetTransparencyRecursive(workspace)
    while XRayEnabled do
        wait(1)
        SetTransparencyRecursive(workspace)
    end
end

-- Fungsi untuk menonaktifkan X-Ray
local function DisableXRay()
    for _, object in pairs(workspace:GetDescendants()) do
        if object:IsA("BasePart") and object.Transparency ~= 0 then
            object.Transparency = 0
        end
    end
end

-- Toggle untuk mengaktifkan dan menonaktifkan X-Ray
Main_Home:addToggle('X-Ray', false, function(state)
    XRayEnabled = state
    if XRayEnabled then
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "X-Ray Enabled",
            Text = "All objects are now visible.",
            Duration = 5,
        })
        spawn(EnableXRay)
    else
        DisableXRay()
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "X-Ray Disabled",
            Text = "Objects are now back to normal.",
            Duration = 5,
        })
    end
end)

---------- [ Misc Tab Section ] ----------
local Misc_Left = Tab.Home:addSection()
local Main_Misc = Misc_Left:addMenu("#Settings")

---------- [ Misc - Farming Speed Textbox ] ----------
Main_Misc:addTextbox('Farming Speed', tostring(FarmingSpeed), function(value)
    local newFarmingSpeed = tonumber(value)
    if newFarmingSpeed and newFarmingSpeed > 0 then
        FarmingSpeed = newFarmingSpeed
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Farming Speed Updated!",
            Text = "Farming speed set to: " .. tostring(newFarmingSpeed),
            Duration = 5,
        })
    else
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "Invalid Input",
            Text = "Please enter a valid positive number for Farming Speed.",
            Duration = 5,
        })
    end
end)

---------- [ ESP Tab Section ] ----------
local ESP_Left = Tab.ESP:addSection()
local Main_ESP = ESP_Left:addMenu("#ESP")

---------- [ Misc - ESP Player Toggle ] ----------
-- Fungsi untuk menambahkan highlight pada player
local function AddPlayerESP(player)
    if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        local highlight = Instance.new("Highlight")
        highlight.Parent = player.Character
        highlight.Adornee = player.Character.HumanoidRootPart
        highlight.FillColor = Color3.fromRGB(255, 0, 0)  -- Highlight berwarna merah
        highlight.FillTransparency = 0.5
        highlight.OutlineColor = Color3.fromRGB(255, 255, 255)  -- Outline berwarna putih
        highlight.OutlineTransparency = 0.5

        -- Menambahkan nama player di atas highlight
        local nameLabel = Instance.new("BillboardGui")
        nameLabel.Parent = player.Character
        nameLabel.Adornee = player.Character.HumanoidRootPart
        nameLabel.Size = UDim2.new(0, 100, 0, 50)
        nameLabel.StudsOffset = Vector3.new(0, 3, 0)
        nameLabel.AlwaysOnTop = true

        local textLabel = Instance.new("TextLabel")
        textLabel.Parent = nameLabel
        textLabel.Size = UDim2.new(1, 0, 1, 0)
        textLabel.Text = player.Name
        textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
        textLabel.BackgroundTransparency = 1
        textLabel.TextStrokeTransparency = 0.5

        -- Menambahkan jarak di atas nama player
        local distanceLabel = Instance.new("TextLabel")
        distanceLabel.Parent = nameLabel
        distanceLabel.Size = UDim2.new(1, 0, 1, 20)
        distanceLabel.Position = UDim2.new(0, 0, 1, 0)
        distanceLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
        distanceLabel.BackgroundTransparency = 1
        distanceLabel.TextStrokeTransparency = 0.5

        -- Update jarak setiap detik
        spawn(function()
            while ESPPlayerEnabled do
                local distance = (player.Character.HumanoidRootPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
                distanceLabel.Text = string.format("Distance: %.2f", distance)
                wait(1)
            end
        end)

        -- Simpan highlight dan label player dalam tabel
        table.insert(PlayerHighlights, {player = player, highlight = highlight, nameLabel = nameLabel})
    end
end

-- Fungsi untuk menghapus ESP player
local function RemovePlayerESP(player)
    for _, esp in pairs(PlayerHighlights) do
        if esp.player == player then
            esp.highlight:Destroy()
            esp.nameLabel:Destroy()
            table.remove(PlayerHighlights, _)
            break
        end
    end
end

-- Fungsi untuk mengaktifkan ESP Player
local function EnableESPPlayer()
    for _, player in pairs(game.Players:GetPlayers()) do
        if player ~= game.Players.LocalPlayer then
            AddPlayerESP(player)
        end
    end

    -- Tambahkan ESP ketika pemain baru bergabung
    game.Players.PlayerAdded:Connect(function(player)
        if player ~= game.Players.LocalPlayer then
            AddPlayerESP(player)
        end
    end)

    -- Hapus ESP ketika pemain meninggalkan permainan
    game.Players.PlayerRemoving:Connect(function(player)
        RemovePlayerESP(player)
    end)
end

-- Fungsi untuk menonaktifkan ESP Player
local function DisableESPPlayer()
    for _, esp in pairs(PlayerHighlights) do
        esp.highlight:Destroy()
        esp.nameLabel:Destroy()
    end
    PlayerHighlights = {}
end

-- Toggle untuk mengaktifkan dan menonaktifkan ESP Player
Main_ESP:addToggle('ESP Player', false, function(state)
    ESPPlayerEnabled = state
    if ESPPlayerEnabled then
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "ESP Player Enabled",
            Text = "Player highlights and distances are now visible.",
            Duration = 5,
        })
        EnableESPPlayer()
    else
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = "ESP Player Disabled",
            Text = "Player highlights and distances are now hidden.",
            Duration = 5,
        })
        DisableESPPlayer()
    end
end)

---------- [ Misc - ESP Chest Toggle ] ----------
Main_ESP:addToggle('ESP Chest', false, function(state)
    ESPEnabled = state

    if state then
        for _, v in pairs(game.Workspace.SandBlocks:GetChildren()) do
            if v:FindFirstChild("Chest") then
                local highlight = Instance.new("Highlight")
                highlight.Parent = v
                highlight.Adornee = v
                highlight.FillColor = Color3.fromRGB(255, 0, 0)
                highlight.FillTransparency = 0.5
                highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
                highlight.OutlineTransparency = 0.5
                table.insert(ChestHighlights, highlight)
            end
        end
    else
        for _, highlight in pairs(ChestHighlights) do
            highlight:Destroy()
        end
        ChestHighlights = {}
    end
end)

-- Update ESP
spawn(function()
    while true do
        if ESPEnabled then
            for _, v in pairs(game.Workspace.SandBlocks:GetChildren()) do
                if v:FindFirstChild("Chest") then
                    local highlightExists = false
                    for _, highlight in pairs(ChestHighlights) do
                        if highlight.Adornee == v then
                            highlightExists = true
                            break
                        end
                    end

                    if not highlightExists then
                        local highlight = Instance.new("Highlight")
                        highlight.Parent = v
                        highlight.Adornee = v
                        highlight.FillColor = Color3.fromRGB(255, 0, 0)
                        highlight.FillTransparency = 0.5
                        highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
                        highlight.OutlineTransparency = 0.5
                        table.insert(ChestHighlights, highlight)
                    end
                end
            end

            for i = #ChestHighlights, 1, -1 do
                local highlight = ChestHighlights[i]
                if not highlight.Adornee or not highlight.Adornee.Parent then
                    highlight:Destroy()
                    table.remove(ChestHighlights, i)
                end
            end
        end
        wait(1)
    end
end)

02 Pulse Hub – Treasure Hunt Simulator

FeatureDescription
XrayView hidden objects

Script:

loadstring(game:HttpGet("https://raw.githubusercontent.com/Mochimochi12321/Loader/refs/heads/main/newloader"))()

03 Auto Sell – Treasure Hunt Simulator

FeatureDescription
Auto SellAutomatically sells items every 5s

Script:

_G.lol = not _G.lol
while _G.lol do wait(5)
    game:GetService("ReplicatedStorage").Events.AreaSell:FireServer()
end

04 AutoFarm – Treasure Hunt Simulator

FeatureDescription
Auto FarmAutomatically collects rewards
Auto RebirthAutomates rebirth process

Script:

local TresureBreakSimulator = Instance.new("ScreenGui")
local BG = Instance.new("Frame")
local Line = Instance.new("Frame")
local ToolBoxBG = Instance.new("Frame")
local ToolBox = Instance.new("TextBox")
local AutoFarm = Instance.new("TextButton")
local AutoRebirth = Instance.new("TextButton")
local Top = Instance.new("TextLabel")
 
--Toggle
local Farm = false
local Rebirth = false
 
--ButtonToggle
local Click1 = false
local Click2 = false
 
TresureBreakSimulator.Name = "TresureBreakSimulator"
TresureBreakSimulator.Parent = game.CoreGui
TresureBreakSimulator.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
BG.Name = "BG"
BG.Parent = TresureBreakSimulator
BG.BackgroundColor3 = Color3.new(1, 0.823529, 0.54902)
BG.BackgroundTransparency = 0.20000000298023
BG.BorderColor3 = Color3.new(0, 0, 0)
BG.BorderSizePixel = 5
BG.Position = UDim2.new(0.604587197, 0, 0.30796814, 0)
BG.Size = UDim2.new(0, 250, 0, 150)
BG.Active = true
BG.Selectable = true
BG.Draggable = true
Line.Name = "Line"
Line.Parent = BG
Line.BackgroundColor3 = Color3.new(0, 0, 0)
Line.BorderSizePixel = 0
Line.Position = UDim2.new(0, 0, 0, 72)
Line.Size = UDim2.new(0, 250, 0, 5)
ToolBoxBG.Name = "ToolBoxBG"
ToolBoxBG.Parent = BG
ToolBoxBG.BackgroundColor3 = Color3.new(1, 0.823529, 0.54902)
ToolBoxBG.BackgroundTransparency = 0.20000000298023
ToolBoxBG.BorderColor3 = Color3.new(0, 0, 0)
ToolBoxBG.BorderSizePixel = 5
ToolBoxBG.Position = UDim2.new(0, 25, 1, 5)
ToolBoxBG.Size = UDim2.new(0, 200, 0, 50)
ToolBox.Name = "ToolBox"
ToolBox.Parent = ToolBoxBG
ToolBox.BackgroundColor3 = Color3.new(0.490196, 0.490196, 0.490196)
ToolBox.BorderColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
ToolBox.BorderSizePixel = 0
ToolBox.Size = UDim2.new(0, 200, 0, 50)
ToolBox.Font = Enum.Font.GothamBold
ToolBox.PlaceholderColor3 = Color3.new(0, 0, 0)
ToolBox.PlaceholderText = "Tool Name"
ToolBox.Text = game.Players.LocalPlayer.Backpack:FindFirstChildOfClass("Tool").Name
ToolBox.TextColor3 = Color3.new(0, 0, 0)
ToolBox.TextSize = 35
ToolBox.TextWrapped = true
AutoFarm.Name = "AutoFarm"
AutoFarm.Parent = BG
AutoFarm.BackgroundColor3 = Color3.new(0.882353, 0.882353, 0.882353)
AutoFarm.BorderColor3 = Color3.new(1, 0, 0)
AutoFarm.BorderSizePixel = 5
AutoFarm.Position = UDim2.new(0, 25, 0, 5)
AutoFarm.Size = UDim2.new(0, 200, 0, 62)
AutoFarm.Font = Enum.Font.GothamBold
AutoFarm.Text = "Auto Farm"
AutoFarm.TextColor3 = Color3.new(1, 0, 0)
AutoFarm.TextScaled = true
AutoFarm.TextSize = 14
AutoFarm.TextWrapped = true
AutoFarm.MouseButton1Click:Connect(function()
	if Click1 then
		Click1 = false
		Farm = false
		AutoFarm.TextColor3 = Color3.new(1,0,0)
		AutoFarm.BorderColor3 = Color3.new(1,0,0)
	else
        if game.Players.LocalPlayer.Character:FindFirstChild(ToolBox.Text) then
			print('Already EquipTool')
		else
            game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Players.LocalPlayer.Backpack[ToolBox.Text])
        end
		Click1 = true
		Farm = true
		AutoFarm.TextColor3 = Color3.new(0,1,0)
		AutoFarm.BorderColor3 = Color3.new(0,1,0)
	end
end)
AutoRebirth.Name = "AutoRebirth"
AutoRebirth.Parent = BG
AutoRebirth.BackgroundColor3 = Color3.new(0.882353, 0.882353, 0.882353)
AutoRebirth.BorderColor3 = Color3.new(1, 0, 0)
AutoRebirth.BorderSizePixel = 5
AutoRebirth.Position = UDim2.new(0, 25, 0, 82)
AutoRebirth.Size = UDim2.new(0, 200, 0, 62)
AutoRebirth.Font = Enum.Font.GothamBold
AutoRebirth.Text = "Auto Rebirth"
AutoRebirth.TextColor3 = Color3.new(1, 0, 0)
AutoRebirth.TextScaled = true
AutoRebirth.TextSize = 14
AutoRebirth.TextWrapped = true
AutoRebirth.MouseButton1Click:Connect(function()
	if Click1 then
		Click1 = false
		Rebirth = false
		AutoRebirth.TextColor3 = Color3.new(1,0,0)
		AutoRebirth.BorderColor3 = Color3.new(1,0,0)
	else
		Click1 = true
		Rebirth = true
		AutoRebirth.TextColor3 = Color3.new(0,1,0)
		AutoRebirth.BorderColor3 = Color3.new(0,1,0)
	end
end)
Top.Name = "Top"
Top.Parent = BG
Top.Active = true
Top.BackgroundColor3 = Color3.new(1, 0.823529, 0.54902)
Top.BorderColor3 = Color3.new(0, 0, 0)
Top.BorderSizePixel = 5
Top.Position = UDim2.new(0, 25, 0, -30)
Top.Selectable = true
Top.Size = UDim2.new(0, 200, 0, 25)
Top.Font = Enum.Font.GothamBold
Top.Text = "Treasure Break Simulator"
Top.TextColor3 = Color3.new(0, 0, 0)
Top.TextScaled = true
Top.TextSize = 14
Top.TextWrapped = true
 
local Character = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
 
function Sell()
	local OldPos = Character.HumanoidRootPart.CFrame
	Character.HumanoidRootPart.CFrame = CFrame.new(3, 10, -160)
	game.ReplicatedStorage.Events.AreaSell:FireServer()
	wait(0.1)
	Character.HumanoidRootPart.CFrame = OldPos
end
 
local function RE()
	while true do
		wait(1)
		if Rebirth == true then
			local a = game.Players.LocalPlayer.PlayerGui.Gui.Buttons.Coins.Amount.Text:gsub(',','')
			local b = game.Players.LocalPlayer.PlayerGui.Gui.Rebirth.Needed.Coins.Amount.Text:gsub(',','')
			print(tonumber(a))
			print(tonumber(b))
			if tonumber(a) > tonumber(b) then 
				warn('Calculation Complete!')
				game.ReplicatedStorage.Events.Rebirth:FireServer()
				ToolBox.Text = "Bucket"
				repeat wait(.1) until game.Players.LocalPlayer.PlayerGui.Gui.Popups.GiveReward.Visible == true
				game.Players.LocalPlayer.PlayerGui.Gui.Popups.GiveReward.Visible = false
				wait()
			end
		end
	end
end
 
spawn(RE)
 
while true do
	wait()
	if Farm then
		local Sand = nil
		local SandName = ""
		for i,v in pairs (game.Workspace.SandBlocks:GetChildren()) do
			if not Farm then 
				Sell()
				break 
			end
			if v:FindFirstChild("Chest") then
				if v.CFrame.X > -40 and v.CFrame.X < 20 and v.CFrame.Z < -175 and v.CFrame.Z > -235 then
					local Next = false
					if v == nil then
						Next = false
					else
						Next = true
						Sand = v
						SandName = v.Name
					end
					if Next == true then
						local Success,Problem = pcall(function()
						if game.Players[game.Players.LocalPlayer.Name].PlayerGui.Gui.Popups.BackpackFull.Visible == true then Sell() end
							Sand.CanCollide = false
							local Coins = game.Players.LocalPlayer.PlayerGui.Gui.Buttons.Coins.Amount.Text
							repeat
								if game.Players[game.Players.LocalPlayer.Name].PlayerGui.Gui.Popups.BackpackFull.Visible == true then Sell() end
								if not Farm then 
									wait(.1)
									Character.HumanoidRootPart.CFrame = CFrame.new(3, 10, -160)
									wait(1)
									break 
								end
								Character.HumanoidRootPart.Anchored = true
								wait()
								Character.HumanoidRootPart.CFrame = Sand.CFrame
								wait()
								Character.HumanoidRootPart.Anchored = false
								Character:WaitForChild(ToolBox.Text)['RemoteClick']:FireServer(game.Workspace.SandBlocks[SandName])
								wait()
							until game.Players.LocalPlayer.PlayerGui.Gui.Buttons.Coins.Amount.Text ~= Coins
							Next = false
						end)
						if Success then
							print('Worked')
						else
							warn(Problem)
						end
					end
				end
			end
		end
	end
end

How to Use the Script

  1. Copy the script from above.
  2. Open Roblox and launch Treasure Hunt Simulator.
  3. Use a script executor such as KRNL, Synapse X, or Fluxus.
  4. Paste the script into the executor and run it.
  5. Enjoy the automated features!

What Are the Benefits of Using These Scripts?

Using these scripts can help you save time and effort in the game. The Auto Farm scripts allow you to collect treasure without manual digging. The Auto Sell script ensures your inventory does not fill up. X-Ray and ESP features give you an edge by revealing hidden objects and players. These scripts make the game more fun and efficient.

Leave a Comment