Treasure Hunt Simulator Auto Farm Chests & More!
Treasure Hunt Simulator Auto Farm Chests & More!
-- Services
local PhysicsService = game:GetService("PhysicsService")
local RunService = game:GetService("RunService")
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local VirtualUser = game:GetService("VirtualUser")
local TeleportService = game:GetService("TeleportService")
local HttpService = game:GetService("HttpService")
function thunt_data.getCrateNames()
local ret_val = {}
for ind, val in pairs(getgenv().thunt_data.crates:GetChildren()) do
ret_val[ind] = val.Name
end
return ret_val
end
getgenv().cheat_vars.chosen_autobuycrate = {}
getgenv().cheat_vars.chosen_autoopencrates = {}
getgenv().cheat_vars.chosen_autofarm = {}
local chests_arr = getgenv().thunt_data.getChestNames(true)
for i,v in pairs(chests_arr) do
getgenv().cheat_vars.chosen_autofarm[v] = false
end
sandblocks = workspace:WaitForChild("SandBlocks")
-- Utility functions
-- Data related functions
local function saveData()
if getgenv().player_data["player"] == nil then
return false
end
local table =
{
cheat_var = getgenv().cheat_vars,
cheat_setting = getgenv().cheat_settings
}
local json = HttpService:JSONEncode(table)
makefolder("THUNT_GUI")
writefile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt",
json)
return true
end
-- Other functions
local function spawnThread(task, ...)
local cor = coroutine.create(task)
local success, message = coroutine.resume(cor, ...)
return cor, success, message
end
-- Cheat functions
updatePlayerData()
getgenv().player_data["root"].Anchored = true
getgenv().player_data["root"].CFrame = CFrame.new(-102, 10, -416)
getgenv().player_data["root"].Anchored = false
-- Removing part
part.TouchEnded:Connect(function(tpart)
if tpart.Parent == getgenv().player_data["character"] then
part:Destroy()
end
end)
end
getgenv().player_data["humanoid"]:EquipTool(getgenv().player_data["tool"])
getgenv().player_data["tool"]:FindFirstChild("RemoteClick"):FireServer(block)
end
getgenv().thunt_data.buy_crate:FireServer(unpack(args))
end
getgenv().thunt_data.open_crate:FireServer(unpack(args))
end
local next_best_item
for i, item in pairs(getgenv().thunt_data[item_type]:GetChildren()) do
if item_type == "shovels" then
local item_tool = item:WaitForChild(item.Name)
local item_configuration = item_tool:WaitForChild("Configurations")
local item_type = item_configuration:WaitForChild("ToolType")
next_best_item = item
min_price = item_price
end
return next_best_item
end
if getgenv().cheat_settings.autobuyshovels then
buyNextBestItem("shovels")
end
if getgenv().cheat_settings.autobuybackpacks then
buyNextBestItem("backpacks")
end
if getgenv().cheat_settings.autobuypets then
buyNextBestItem("pets")
end
updatePlayerData()
end
-- Free gamepasses
local oldFunction
oldFunction = hookmetamethod(game, "__namecall", newcclosure(function(Self, ...)
if not checkcaller() then
if Self == MarketplaceService then
local method = getnamecallmethod()
if method == "UserOwnsGamePassAsync" then
if getgenv().cheat_settings.freegamepass then
return true
else
return oldFunction(Self, ...)
end
end
end
end
return oldFunction(Self, ...)
end))
-- Autochest
local function autoChest(chests)
local block = findChest(chests) or getFirstBlock()
if block == nil then
return
end
local hp = block.Health.Value
local retries = 0
while getgenv().cheat_settings.autochest and block ~= nil do
if block.Parent ~= sandblocks then
break
end
if getgenv().cheat_settings.autosell then
if checkMaxBackpack() then
sellReturn()
buyEverything()
end
end
getgenv().cheat_settings.gcollide = false
teleportTo(block.CFrame + Vector3.new(0, block.Size.Y, 0))
digBlock(block)
wait(getgenv().player_data["tool"]:WaitForChild("Configurations"):WaitForChild("Att
ackLength").Value)
hp = block.Health.Value
end
end
-- Anti afk
getgenv().player_data["player"].Idled:Connect(function()
if getgenv().cheat_settings.antiafk == true then
VirtualUser:Button2Down(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
wait(1)
VirtualUser:Button2Up(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
end
end)
-- Noclip
RunService.Stepped:Connect(function()
getgenv().player_data["character"].HumanoidRootPart.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].Head.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].UpperTorso.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].LowerTorso.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].LeftUpperArm.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].LeftLowerArm.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].LeftHand.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].RightUpperArm.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].RightLowerArm.CanCollide =
getgenv().cheat_settings.gcollide
getgenv().player_data["character"].RightHand.CanCollide =
getgenv().cheat_settings.gcollide
end)
-- GUI
local KavoLibrary =
loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/
main/source.lua"))()
-- Main tab
local main_tab = window:NewTab("Main")
local autofarm_section = main_tab:NewSection("Main")
autofarm_section:NewLabel("Autofarm Chests")
autofarm_section:NewToggle("On/Off", "Teleports around the map collecting chests",
function(state)
getgenv().cheat_settings.autochest = state
end)
autofarm_section:NewToggle("Auto buy pets", "Buys the best available pet when you
get enough money.", function(state)
getgenv().cheat_settings.autobuypets = state
end)
autofarm_section:NewToggle("Auto buy crates", "Buys the chosen crates pet you have
enough money.", function(state)
getgenv().cheat_settings.autobuycrates = state
end)
-- Misc tab
local misc_tab = window:NewTab("Misc")
local gamepass_section = misc_tab:NewSection("Free gamepasses | NOT WORKING")
gamepass_section:NewToggle("On/Off", "Unlocks all the gamepasses that are possible
to unlock.", function(state)
getgenv().cheat_settings.freegamepass = state
end)
local crates_section = misc_tab:NewSection("Crates")
-- Cheat logic
-- Saving data
spawnThread(function()
while wait(15) do
if getgenv().cheat_settings.savesettings then
saveData()
end
end
end)
-- Auto chest
spawnThread(function()
while wait() do
while getgenv().cheat_settings.autochest do
if getgenv().player_data["character"] == nil or
getgenv().player_data["tool"] == nil then
updatePlayerData()
end
local arr = {}
autoChest(arr)
buyEverything()
wait()
end
end
end)
-- Auto rebirth
spawnThread(function()
while wait() do
while getgenv().cheat_settings.autorebirth do
rebirth()
wait(5)
end
end
end)
-- Auto buy crates
spawnThread(function()
while wait() do
while getgenv().cheat_settings.autobuycrates do
for k,v in pairs(getgenv().cheat_vars.chosen_autobuycrate) do
if v == true then
buyCrate(k, getgenv().player_data["player"].Name, 1)
end
end
wait(0.5)
end
end
end)
getgenv().player_data["player"].OnTeleport:Connect(function(state)
if state == Enum.TeleportState.Started then
syn.queue_on_teleport(game:HttpGet("https://raw.githubusercontent.com/
glof2/thuntgui/main/GUI.lua"))
can_teleport = false
end
if state == Enum.TeleportState.Failed then
can_teleport = true
end
end)