Advertisement
Guest User

Treasure Hunt Simulator Script

a guest
Apr 24th, 2022
38,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.65 KB | None | 0 0
  1. repeat wait() until game:IsLoaded()
  2.  
  3. -- Making sure the game is Treasure Hunt Simulator
  4. if game.PlaceId ~= 1345139196 then
  5. game.Players.LocalPlayer:Kick("This script only works on Treasure Hunt Simulator!")
  6. end
  7. if getgenv().thunt_gui_executed then
  8. game.Players.LocalPlayer:Kick("GUI executed twice!")
  9. end
  10.  
  11. -- Services
  12. local PhysicsService = game:GetService("PhysicsService")
  13. local RunService = game:GetService("RunService")
  14. local MarketplaceService = game:GetService("MarketplaceService")
  15. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  16. local Players = game:GetService("Players")
  17. local VirtualUser = game:GetService("VirtualUser")
  18. local TeleportService = game:GetService("TeleportService")
  19. local HttpService = game:GetService("HttpService")
  20.  
  21. -- Global Environment Variables
  22. getgenv().thunt_gui_executed = true
  23. getgenv().cheat_settings = {}
  24. getgenv().cheat_settings.autochest = false
  25. getgenv().cheat_settings.autosell = false
  26. getgenv().cheat_settings.autobuyshovels = false
  27. getgenv().cheat_settings.autobuybackpacks = false
  28. getgenv().cheat_settings.autobuypets = false
  29. getgenv().cheat_settings.autorebirth = false
  30. getgenv().cheat_settings.autobuycrates = false
  31. getgenv().cheat_settings.autoopencrates = false
  32. getgenv().cheat_settings.freegamepass = false
  33. getgenv().cheat_settings.gcollide = true
  34. getgenv().cheat_settings.autoinvisible = false
  35. getgenv().cheat_settings.walkspeed = false
  36. getgenv().cheat_settings.jumppower = false
  37. getgenv().cheat_settings.autoserverhop = false
  38. getgenv().cheat_settings.antiafk = true
  39. getgenv().cheat_settings.savesettings = false
  40.  
  41. -- Predefining needed game data
  42. getgenv().thunt_data = {}
  43. getgenv().thunt_data.chests = ReplicatedStorage:WaitForChild("Chests")
  44. getgenv().thunt_data.crates = ReplicatedStorage:WaitForChild("Crates")
  45. getgenv().thunt_data.shovels = ReplicatedStorage:WaitForChild("Shovels")
  46. getgenv().thunt_data.backpacks = ReplicatedStorage:WaitForChild("Backpacks")
  47. getgenv().thunt_data.pets = ReplicatedStorage:WaitForChild("Pets")
  48. getgenv().thunt_data.gamepasses = ReplicatedStorage:WaitForChild("Gamepasses")
  49. getgenv().thunt_data.buy_item = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Checkout")
  50. getgenv().thunt_data.buy_crate = ReplicatedStorage:WaitForChild("Events"):WaitForChild("BuyCrate")
  51. getgenv().thunt_data.open_crate = ReplicatedStorage:WaitForChild("Events"):WaitForChild("SendOpenCrate")
  52. getgenv().thunt_data.rebirth = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Rebirth")
  53. getgenv().thunt_data.check_if_owned = ReplicatedStorage:WaitForChild("Events"):WaitForChild("CheckIfOwned")
  54.  
  55. function thunt_data.getChestNames(with_health)
  56. local ret_val = {}
  57. for ind, val in pairs(getgenv().thunt_data.chests:GetChildren()) do
  58. if with_health then
  59. ret_val[ind] = val.Name.." ("..val:WaitForChild("Health").Value..")"
  60. else
  61. ret_val[ind] = val.Name
  62. end
  63. end
  64. return ret_val
  65. end
  66.  
  67. function thunt_data.getCrateNames()
  68. local ret_val = {}
  69. for ind, val in pairs(getgenv().thunt_data.crates:GetChildren()) do
  70. ret_val[ind] = val.Name
  71. end
  72. return ret_val
  73. end
  74.  
  75. -- Predefining player data
  76. getgenv().player_data = {}
  77.  
  78. -- Cheat needed variables
  79. getgenv().cheat_vars = {}
  80. getgenv().cheat_vars.walkspeed = 16
  81. getgenv().cheat_vars.jumppower = 50
  82. getgenv().cheat_vars.servermin = 6
  83. getgenv().cheat_vars.servermax= 14
  84.  
  85. getgenv().cheat_vars.chosen_autobuycrate = {}
  86. getgenv().cheat_vars.chosen_autoopencrates = {}
  87.  
  88. local crates_arr = getgenv().thunt_data.getCrateNames()
  89. for i,v in pairs(crates_arr) do
  90. getgenv().cheat_vars.chosen_autobuycrate[v] = false
  91. getgenv().cheat_vars.chosen_autoopencrates[v] = false
  92. end
  93.  
  94.  
  95. getgenv().cheat_vars.chosen_autofarm = {}
  96. local chests_arr = getgenv().thunt_data.getChestNames(true)
  97. for i,v in pairs(chests_arr) do
  98. getgenv().cheat_vars.chosen_autofarm[v] = false
  99. end
  100.  
  101. sandblocks = workspace:WaitForChild("SandBlocks")
  102.  
  103. -- Utility functions
  104. -- Data related functions
  105. local function saveData()
  106. if getgenv().player_data["player"] == nil then
  107. return false
  108. end
  109. local table =
  110. {
  111. cheat_var = getgenv().cheat_vars,
  112. cheat_setting = getgenv().cheat_settings
  113. }
  114. local json = HttpService:JSONEncode(table)
  115. makefolder("THUNT_GUI")
  116. writefile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt", json)
  117. return true
  118. end
  119.  
  120. local function loadData()
  121. if getgenv().player_data["player"] == nil then
  122. return false
  123. end
  124. if(not isfile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt")) then
  125. return nil
  126. end
  127. local file_content = readfile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt")
  128. local table = HttpService:JSONDecode(file_content)
  129. if table.cheat_setting.savesettings == true then
  130. getgenv().cheat_vars = table.cheat_var
  131. getgenv().cheat_settings = table.cheat_setting
  132. end
  133. return true
  134. end
  135.  
  136. local function removeData()
  137. if getgenv().player_data["player"] == nil then
  138. return false
  139. end
  140. if isfile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt") then
  141. delfile("THUNT_GUI\\data_"..getgenv().player_data["player"].Name.."v1.txt")
  142. end
  143. end
  144.  
  145. -- Other functions
  146. local function spawnThread(task, ...)
  147. local cor = coroutine.create(task)
  148. local success, message = coroutine.resume(cor, ...)
  149. return cor, success, message
  150. end
  151.  
  152. local function updatePlayerData()
  153. getgenv().player_data["player"] = Players.LocalPlayer
  154. getgenv().player_data["character"] = getgenv().player_data["player"].Character or getgenv().player_data["player"].CharacterAdded:Wait()
  155. getgenv().player_data["humanoid"] = getgenv().player_data["character"]:WaitForChild("Humanoid")
  156. getgenv().player_data["root"] = getgenv().player_data["character"]:WaitForChild("HumanoidRootPart")
  157. getgenv().player_data["tool"] = nil
  158. for ind, val in pairs(getgenv().player_data["player"]:WaitForChild("Backpack"):GetChildren()) do
  159. if val:IsA("Tool") then
  160. getgenv().player_data["tool"] = val
  161. break
  162. end
  163. end
  164.  
  165. if getgenv().player_data["tool"] == nil then
  166. for ind, val in pairs(getgenv().player_data["character"]:GetChildren()) do
  167. if val:IsA("Tool") then
  168. getgenv().player_data["tool"] = val
  169. break
  170. end
  171. end
  172. end
  173. getgenv().player_data["coins"] = getgenv().player_data["player"]:WaitForChild("leaderstats"):WaitForChild("Coins")
  174. end
  175.  
  176. local function createInstance(inst, args)
  177. local instance = Instance.new(inst)
  178. -- Instance properties
  179. for key, value in pairs(args) do
  180. instance[key] = value
  181. end
  182. return instance
  183. end
  184.  
  185. local function strToVec2(str, char)
  186. local temp = string.split(str, char)
  187. return {temp[1], temp[2]}
  188. end
  189.  
  190. -- Cheat functions
  191. updatePlayerData()
  192.  
  193. local function goInvisible()
  194. local clone = getgenv().player_data["character"]:WaitForChild("LowerTorso"):WaitForChild("Root"):Clone()
  195. local before_tp = getgenv().player_data["root"].CFrame
  196.  
  197. getgenv().player_data["root"].Anchored = true
  198. getgenv().player_data["root"].CFrame = CFrame.new(-102, 10, -416)
  199. getgenv().player_data["root"].Anchored = false
  200.  
  201. local part = createInstance("Part",
  202. {
  203. Anchored = true,
  204. CFrame = CFrame.new(-102, 10, -416),
  205. Size = Vector3.new(5, 5, 5),
  206. CanTouch = true,
  207. CanCollide = false,
  208. Parent = workspace
  209. })
  210. part.Touched:Connect(function()
  211. game.Players.LocalPlayer.Character.LowerTorso.Root:Destroy()
  212. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = before_tp
  213. part:Destroy()
  214. end)
  215. end
  216.  
  217. local function serverHop(min_players, max_players)
  218. local servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100"))
  219. local teleported = false
  220. local cursor = ""
  221. while not teleported do
  222. if servers.nextPageCursor ~= nil then
  223. for i,v in pairs(servers.data) do
  224. if v.playing < min_players then
  225. continue
  226. end
  227. if v.playing > max_players then
  228. continue
  229. end
  230. teleported = true
  231. TeleportService:TeleportToPlaceInstance(game.PlaceId, v.id)
  232. break
  233. end
  234. if not teleported then
  235. cursor = servers.nextPageCursor
  236. servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100&cursor="..cursor))
  237. end
  238. else
  239. wait(10)
  240. servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100&cursor="..cursor))
  241. end
  242. wait(1)
  243. end
  244. end
  245.  
  246. local function teleportTo(cframe)
  247. getgenv().player_data["root"].CFrame = cframe
  248. end
  249.  
  250. local function setWalkSpeed(number)
  251. getgenv().player_data["humanoid"].WalkSpeed = number
  252. end
  253.  
  254. local function setJumpPower(number)
  255. getgenv().player_data["humanoid"].JumpPower = number
  256. end
  257.  
  258. local function platformStand()
  259. local args =
  260. {
  261. Anchored = true,
  262. Parent = workspace,
  263. CFrame = getgenv().player_data["root"].CFrame - Vector3.new(0, 3.6, 0)
  264. }
  265.  
  266. local part = createInstance("Part", args)
  267.  
  268. -- Removing part
  269. part.TouchEnded:Connect(function(tpart)
  270. if tpart.Parent == getgenv().player_data["character"] then
  271. part:Destroy()
  272. end
  273. end)
  274. end
  275.  
  276. local function findChest(filters)
  277. for ind1, part1 in pairs(sandblocks:GetChildren()) do
  278. if part1:FindFirstChild("Chest") then
  279. local chest_type = part1:FindFirstChild("Mat")
  280. if chest_type == nil then
  281. continue
  282. end
  283. for i,v in pairs(filters) do
  284. if v == chest_type.Value or v:match(chest_type.Value) then
  285. return part1
  286. end
  287. end
  288. end
  289. end
  290. return nil
  291. end
  292.  
  293. local function getFirstBlock()
  294. local children = sandblocks:GetChildren()
  295. for i,v in pairs(children) do
  296. if v:FindFirstChild("Rock") == nil and v:FindFirstChild("Chest") == nil then
  297. return v
  298. end
  299. end
  300. return nil
  301. end
  302.  
  303. local function digBlock(block)
  304. while getgenv().player_data["tool"] == nil do
  305. updatePlayerData()
  306. wait()
  307. end
  308. while(getgenv().player_data["tool"].Parent ~= getgenv().player_data["character"] and getgenv().player_data["tool"].Parent ~= getgenv().player_data["player"]:WaitForChild("Backpack")) do
  309. updatePlayerData()
  310. wait()
  311. end
  312.  
  313. getgenv().player_data["humanoid"]:EquipTool(getgenv().player_data["tool"])
  314.  
  315. getgenv().player_data["tool"]:FindFirstChild("RemoteClick"):FireServer(block)
  316. end
  317.  
  318. local function checkMaxBackpack()
  319. local amount = getgenv().player_data["player"]:WaitForChild("PlayerGui"):WaitForChild("Gui"):WaitForChild("Buttons"):WaitForChild("Sand"):WaitForChild("Amount")
  320. local backpack_status = strToVec2(amount.Text, " / ")
  321. return backpack_status[1] == backpack_status[2]
  322. end
  323.  
  324. local function sell()
  325. while checkMaxBackpack() do
  326. teleportTo(CFrame.new(2201.05762, 9.94674683, -254.006104))
  327. wait()
  328. end
  329. end
  330.  
  331. local function sellReturn()
  332. local cframe = getgenv().player_data["root"].CFrame
  333. sell()
  334. getgenv().player_data["root"].CFrame = cframe
  335. end
  336.  
  337. local function checkIfItemOwned(item_name)
  338. getgenv().thunt_data.check_if_owned:InvokeServer(item_name)
  339. end
  340.  
  341. local function buyItem(item_name)
  342. local args =
  343. {
  344. [1] = item_name
  345. }
  346. getgenv().thunt_data.buy_item:FireServer(unpack(args))
  347. end
  348.  
  349. local function buyCrate(crate_name, target_name,quantity)
  350. local args =
  351. {
  352. [1] = getgenv().thunt_data.crates[crate_name],
  353. [2] = target_name,
  354. [3] = quantity
  355. }
  356.  
  357. getgenv().thunt_data.buy_crate:FireServer(unpack(args))
  358. end
  359.  
  360. local function openCrate(crate_name)
  361. local args =
  362. {
  363. [1] = getgenv().thunt_data.crates[crate_name]
  364. }
  365.  
  366. getgenv().thunt_data.open_crate:FireServer(unpack(args))
  367. end
  368.  
  369. local function rebirth()
  370. getgenv().thunt_data.rebirth:FireServer()
  371. end
  372.  
  373. local function getCurrentItem(item_type)
  374. if string.lower(item_type) == "shovels" then
  375. return getgenv().player_data["tool"].Name
  376. elseif string.lower(item_type) == "backpacks" then
  377. local backpack
  378. for i,v in pairs(getgenv().player_data["character"]:GetChildren()) do
  379. if v:IsA("Model") then
  380. return v.Name
  381. end
  382. end
  383. elseif string.lower(item_type) == "pets" then
  384. local pet_holder = getgenv().player_data["character"]:WaitForChild("PetHolder")
  385. local children = pet_holder:GetChildren()
  386. if #children == 0 then
  387. return "None"
  388. end
  389. return children[1].Name
  390. end
  391. end
  392.  
  393. local function getNextBestItem(item_type, max_price)
  394. local current_item_name = getCurrentItem(item_type)
  395. if current_item_name == nil then
  396. return nil
  397. end
  398. local current_item
  399. local min_price
  400. if current_item_name ~= "None" then
  401. current_item = getgenv().thunt_data[item_type][current_item_name]
  402. if current_item == nil then
  403. return nil
  404. end
  405. min_price = current_item:WaitForChild("Price").Value
  406. else
  407. min_price = 0
  408. end
  409.  
  410. local next_best_item
  411. for i, item in pairs(getgenv().thunt_data[item_type]:GetChildren()) do
  412. if item_type == "shovels" then
  413. local item_tool = item:WaitForChild(item.Name)
  414. local item_configuration = item_tool:WaitForChild("Configurations")
  415. local item_type = item_configuration:WaitForChild("ToolType")
  416.  
  417. if item_type.Value == "Bomb" then
  418. continue
  419. end
  420. end
  421.  
  422. local item_price = item:WaitForChild("Price").Value
  423.  
  424. if item_price <= min_price then
  425. continue
  426. elseif item_price > max_price then
  427. continue
  428. end
  429.  
  430. next_best_item = item
  431. min_price = item_price
  432. end
  433. return next_best_item
  434. end
  435.  
  436. local function buyNextBestItem(item_type)
  437. local item = getNextBestItem(item_type, getgenv().player_data["coins"].Value)
  438. if item == nil then
  439. return
  440. end
  441. buyItem(item.Name)
  442. end
  443.  
  444. local function buyEverything()
  445. if getgenv().cheat_settings.autorebirth then
  446. rebirth()
  447. end
  448.  
  449. if getgenv().cheat_settings.autobuyshovels then
  450. buyNextBestItem("shovels")
  451. end
  452.  
  453. if getgenv().cheat_settings.autobuybackpacks then
  454. buyNextBestItem("backpacks")
  455. end
  456.  
  457. if getgenv().cheat_settings.autobuypets then
  458. buyNextBestItem("pets")
  459. end
  460.  
  461. updatePlayerData()
  462. end
  463.  
  464. -- Free gamepasses
  465. local oldFunction
  466. oldFunction = hookmetamethod(game, "__namecall", newcclosure(function(Self, ...)
  467. if not checkcaller() then
  468. if Self == MarketplaceService then
  469. local method = getnamecallmethod()
  470. if method == "UserOwnsGamePassAsync" then
  471. if getgenv().cheat_settings.freegamepass then
  472. return true
  473. else
  474. return oldFunction(Self, ...)
  475. end
  476. end
  477. end
  478. end
  479. return oldFunction(Self, ...)
  480. end))
  481.  
  482. -- Autochest
  483. local function autoChest(chests)
  484. local block = findChest(chests) or getFirstBlock()
  485. if block == nil then
  486. return
  487. end
  488. local hp = block.Health.Value
  489. local retries = 0
  490. while getgenv().cheat_settings.autochest and block ~= nil do
  491. if block.Parent ~= sandblocks then
  492. break
  493. end
  494.  
  495. if getgenv().cheat_settings.autosell then
  496. if checkMaxBackpack() then
  497. sellReturn()
  498. buyEverything()
  499. end
  500. end
  501.  
  502.  
  503. getgenv().cheat_settings.gcollide = false
  504. teleportTo(block.CFrame + Vector3.new(0, block.Size.Y, 0))
  505. digBlock(block)
  506. wait(getgenv().player_data["tool"]:WaitForChild("Configurations"):WaitForChild("AttackLength").Value)
  507.  
  508. if block.Health.Value >= hp then
  509. retries = retries + 1
  510. else
  511. retries = 0
  512. end
  513.  
  514. if retries >= 3 then
  515. block.Parent = nil
  516. break
  517. end
  518.  
  519. hp = block.Health.Value
  520. end
  521. end
  522.  
  523. -- Cheat event functions
  524. -- Auto character update
  525. getgenv().player_data["player"].CharacterAdded:Connect(function(char)
  526. updatePlayerData()
  527. if getgenv().cheat_settings.autoinvisible then
  528. goInvisible()
  529. end
  530. end)
  531.  
  532. -- Anti afk
  533. getgenv().player_data["player"].Idled:Connect(function()
  534. if getgenv().cheat_settings.antiafk == true then
  535. VirtualUser:Button2Down(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
  536. wait(1)
  537. VirtualUser:Button2Up(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
  538. end
  539. end)
  540.  
  541. -- Noclip
  542. RunService.Stepped:Connect(function()
  543. getgenv().player_data["character"].HumanoidRootPart.CanCollide = getgenv().cheat_settings.gcollide
  544. getgenv().player_data["character"].Head.CanCollide = getgenv().cheat_settings.gcollide
  545. getgenv().player_data["character"].UpperTorso.CanCollide = getgenv().cheat_settings.gcollide
  546. getgenv().player_data["character"].LowerTorso.CanCollide = getgenv().cheat_settings.gcollide
  547. getgenv().player_data["character"].LeftUpperArm.CanCollide = getgenv().cheat_settings.gcollide
  548. getgenv().player_data["character"].LeftLowerArm.CanCollide = getgenv().cheat_settings.gcollide
  549. getgenv().player_data["character"].LeftHand.CanCollide = getgenv().cheat_settings.gcollide
  550. getgenv().player_data["character"].RightUpperArm.CanCollide = getgenv().cheat_settings.gcollide
  551. getgenv().player_data["character"].RightLowerArm.CanCollide = getgenv().cheat_settings.gcollide
  552. getgenv().player_data["character"].RightHand.CanCollide = getgenv().cheat_settings.gcollide
  553. end)
  554.  
  555. -- Jumpspeed and walkspeed
  556. RunService.Stepped:Connect(function()
  557. if getgenv().cheat_settings.walkspeed then
  558. setWalkSpeed(getgenv().cheat_vars["walkspeed"])
  559. end
  560. if getgenv().cheat_settings.jumppower then
  561. setJumpPower(getgenv().cheat_vars["jumppower"])
  562. end
  563. end)
  564.  
  565. while loadData() == false do
  566. wait(1)
  567. end
  568.  
  569. -- GUI
  570. local KavoLibrary = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  571.  
  572. local window = KavoLibrary.CreateLib("Treasure Hunt", "Midnight")
  573.  
  574. -- Main tab
  575. local main_tab = window:NewTab("Main")
  576. local autofarm_section = main_tab:NewSection("Main")
  577. autofarm_section:NewLabel("Autofarm Chests")
  578. autofarm_section:NewToggle("On/Off", "Teleports around the map collecting chests", function(state)
  579. getgenv().cheat_settings.autochest = state
  580. end)
  581.  
  582. local text = "Chests: "
  583. for k,v in pairs(getgenv().cheat_vars.chosen_autofarm) do
  584. if v == true then
  585. text = text..k..", "
  586. end
  587. end
  588.  
  589. local label = autofarm_section:NewLabel(text)
  590. autofarm_section:NewDropdown("Chests", "Which chests to autofarm", chests_arr, function(currentOption)
  591. getgenv().cheat_vars.chosen_autofarm[currentOption] = not(getgenv().cheat_vars.chosen_autofarm[currentOption])
  592. local new_text = "Chests: "
  593. for k,v in pairs(getgenv().cheat_vars.chosen_autofarm) do
  594. if v == true then
  595. new_text = new_text..k..", "
  596. end
  597. end
  598. label:UpdateLabel(new_text)
  599. end)
  600.  
  601. autofarm_section:NewToggle("Auto rebirth", "Automatically rebirths when possible.", function(state)
  602. getgenv().cheat_settings.autorebirth = state
  603. end)
  604.  
  605. autofarm_section:NewToggle("Auto sell", "Automatically sells when your backpack is full", function(state)
  606. getgenv().cheat_settings.autosell = state
  607. end)
  608.  
  609. autofarm_section:NewToggle("Auto buy shovels", "Buys the best available shovel when you get enough money.", function(state)
  610. getgenv().cheat_settings.autobuyshovels = state
  611. end)
  612.  
  613. autofarm_section:NewToggle("Auto buy backpacks", "Buys the best available backpack when you get enough money.", function(state)
  614. getgenv().cheat_settings.autobuybackpacks = state
  615. end)
  616.  
  617. autofarm_section:NewToggle("Auto buy pets", "Buys the best available pet when you get enough money.", function(state)
  618. getgenv().cheat_settings.autobuypets = state
  619. end)
  620.  
  621. autofarm_section:NewLabel("Auto server hop")
  622.  
  623. autofarm_section:NewToggle("Auto server hop", "Will server hop if there's too many or too few players.", function(state)
  624. getgenv().cheat_settings.autoserverhop = state
  625. end)
  626.  
  627. autofarm_section:NewSlider("Minimum Players: ", "", 14, 1, function(val)
  628. getgenv().cheat_vars.servermin = val - 1
  629. end)
  630.  
  631. autofarm_section:NewSlider("Maximum Players: ", "", 14, 1, function(val)
  632. getgenv().cheat_vars.servermax = val + 1
  633. end)
  634.  
  635. autofarm_section:NewLabel("Auto buy crates")
  636.  
  637. local crate_text = "Crates: "
  638. for k,v in pairs(getgenv().cheat_vars.chosen_autobuycrate) do
  639. if v == true then
  640. crate_text = crate_text..k..", "
  641. end
  642. end
  643.  
  644. local autocrates_label = autofarm_section:NewLabel(crate_text)
  645.  
  646. autofarm_section:NewToggle("Auto buy crates", "Buys the chosen crates pet you have enough money.", function(state)
  647. getgenv().cheat_settings.autobuycrates = state
  648. end)
  649.  
  650. autofarm_section:NewDropdown("Choose crates", "Which crates to buy", crates_arr, function(current_option)
  651. getgenv().cheat_vars.chosen_autobuycrate[current_option] = not(getgenv().cheat_vars.chosen_autobuycrate[current_option])
  652. local new_text = "Crates: "
  653. for k,v in pairs(getgenv().cheat_vars.chosen_autobuycrate) do
  654. if v == true then
  655. new_text = new_text..k..", "
  656. end
  657. end
  658. autocrates_label:UpdateLabel(new_text)
  659. end)
  660.  
  661. autofarm_section:NewLabel("Auto open crates")
  662.  
  663. local autocrate_text = "Crates: "
  664. for k,v in pairs(getgenv().cheat_vars.chosen_autoopencrates) do
  665. if v == true then
  666. autocrate_text = autocrate_text..k..", "
  667. end
  668. end
  669.  
  670. local autocrates_label = autofarm_section:NewLabel(crate_text)
  671.  
  672. autofarm_section:NewToggle("Auto open crates", "Opens selected crates.", function(state)
  673. getgenv().cheat_settings.autoopencrates = state
  674. end)
  675.  
  676. autofarm_section:NewDropdown("Choose crates", "Which crates to open", crates_arr, function(current_option)
  677. getgenv().cheat_vars.chosen_autoopencrates[current_option] = not(getgenv().cheat_vars.chosen_autoopencrates[current_option])
  678. local new_text = "Crates: "
  679. for k,v in pairs(getgenv().cheat_vars.chosen_autoopencrates) do
  680. if v == true then
  681. new_text = new_text..k..", "
  682. end
  683. end
  684. autocrates_label:UpdateLabel(new_text)
  685. end)
  686.  
  687. -- Misc tab
  688. local misc_tab = window:NewTab("Misc")
  689. local gamepass_section = misc_tab:NewSection("Free gamepasses | NOT WORKING")
  690. gamepass_section:NewToggle("On/Off", "Unlocks all the gamepasses that are possible to unlock.", function(state)
  691. getgenv().cheat_settings.freegamepass = state
  692. end)
  693. local crates_section = misc_tab:NewSection("Crates")
  694.  
  695. local chosen_crate = "Tier1"
  696. local chosen_player = getgenv().player_data["player"].Name
  697. local chosen_quantity = 1
  698.  
  699. crates_section:NewDropdown("Choose crate", "Which crate to buy", crates_arr, function(current_option)
  700. chosen_crate = current_option
  701. end)
  702.  
  703. local player_list = Players:GetPlayers()
  704. for i,v in pairs(player_list) do
  705. player_list[i] = v.Name
  706. end
  707.  
  708. local player_dropdown = crates_section:NewDropdown(chosen_player, "Choose player", player_list, function(current_option)
  709. chosen_player = current_option
  710. end)
  711.  
  712. crates_section:NewButton("Refresh", "Refresh player list", function()
  713. player_list = Players:GetPlayers()
  714. for i,v in pairs(player_list) do
  715. player_list[i] = v.Name
  716. end
  717. player_dropdown:Refresh(player_list)
  718. end)
  719.  
  720. crates_section:NewSlider("Quantity", "", 100, 1, function(val)
  721. chosen_quantity = val
  722. end)
  723.  
  724. crates_section:NewButton("Buy", "Buy Crates", function()
  725. buyCrate(chosen_crate, chosen_player, chosen_quantity)
  726. end)
  727.  
  728. -- Local Player Tab
  729. local localplayer_tab = window:NewTab("Local Player")
  730. local walkspeed_section = localplayer_tab:NewSection("Walk speed")
  731. walkspeed_section:NewToggle("On/Off", "Walk speed cheat.", function(state)
  732. getgenv().cheat_settings.walkspeed = state
  733. end)
  734.  
  735. walkspeed_section:NewSlider("Walk speed", "", 500, 16, function(val)
  736. getgenv().cheat_vars.walkspeed = val
  737. end)
  738.  
  739. local jumppower_section = localplayer_tab:NewSection("Jump power")
  740. jumppower_section:NewToggle("On/Off", "Jump power cheat.", function(state)
  741. getgenv().cheat_settings.jumppower = state
  742. end)
  743. jumppower_section:NewSlider("Jump Power", "", 500, 16, function(val)
  744. getgenv().cheat_vars.jumppower = val
  745. end)
  746.  
  747. local other_section = localplayer_tab:NewSection("Other")
  748. other_section:NewButton("Kill player", "Kills the player", function()
  749. getgenv().player_data["humanoid"].Health = 0
  750. end)
  751.  
  752. other_section:NewToggle("Auto Invisible", "Makes you automatically go invisible", function(state)
  753. getgenv().cheat_settings.autoinvisible = state
  754. if getgenv().cheat_settings.autoinvisible then
  755. pcall(function()
  756. goInvisible()
  757. end)
  758. end
  759. end)
  760.  
  761. other_section:NewToggle("Noclip", "Noclip", function(state)
  762. getgenv().cheat_settings.gcollide = not state
  763. end)
  764. local antiafk
  765. antiafk = other_section:NewButton("Anti afk (on)", "Anti afk", function()
  766. getgenv().cheat_settings.antiafk = not getgenv().cheat_settings.antiafk
  767. if getgenv().cheat_settings.antiafk then
  768. antiafk:UpdateButton("Anti afk (on)")
  769. else
  770. antiafk:UpdateButton("Anti afk (off)")
  771. end
  772. end)
  773.  
  774. other_section:NewToggle("Save settings", "Save settings", function(state)
  775. getgenv().cheat_settings.savesettings = state
  776. saveData()
  777. end)
  778.  
  779. -- Cheat logic
  780.  
  781. -- Saving data
  782. spawnThread(function()
  783. while wait(15) do
  784. if getgenv().cheat_settings.savesettings then
  785. saveData()
  786. end
  787. end
  788. end)
  789.  
  790. -- Auto chest
  791. spawnThread(function()
  792. while wait() do
  793. while getgenv().cheat_settings.autochest do
  794. if getgenv().player_data["character"] == nil or getgenv().player_data["tool"] == nil then
  795. updatePlayerData()
  796. end
  797.  
  798. local arr = {}
  799.  
  800. for k,v in pairs(getgenv().cheat_vars.chosen_autofarm) do
  801. if v == true then
  802. table.insert(arr, k)
  803. end
  804. end
  805.  
  806. autoChest(arr)
  807.  
  808. buyEverything()
  809. wait()
  810. end
  811. end
  812. end)
  813.  
  814. -- Auto rebirth
  815. spawnThread(function()
  816. while wait() do
  817. while getgenv().cheat_settings.autorebirth do
  818. rebirth()
  819. wait(5)
  820. end
  821. end
  822. end)
  823.  
  824. -- Auto buy crates
  825. spawnThread(function()
  826. while wait() do
  827. while getgenv().cheat_settings.autobuycrates do
  828. for k,v in pairs(getgenv().cheat_vars.chosen_autobuycrate) do
  829. if v == true then
  830. buyCrate(k, getgenv().player_data["player"].Name, 1)
  831. end
  832. end
  833. wait(0.5)
  834. end
  835. end
  836. end)
  837.  
  838. -- Auto open crates
  839. spawnThread(function()
  840. while wait() do
  841. while getgenv().cheat_settings.autoopencrates do
  842. for k,v in pairs(getgenv().cheat_vars.chosen_autoopencrates) do
  843. if v == true then
  844. openCrate(k)
  845. end
  846. end
  847. wait()
  848. end
  849. end
  850. end)
  851.  
  852. -- Auto server hop
  853. local can_teleport = true
  854. spawnThread(function()
  855. while wait() do
  856. while getgenv().cheat_settings.autoserverhop do
  857. if can_teleport == true then
  858. if #Players:GetPlayers() < getgenv().cheat_vars.servermin then
  859. serverHop(getgenv().cheat_vars.servermin, getgenv().cheat_vars.servermax)
  860. end
  861. if #Players:GetPlayers() > getgenv().cheat_vars.servermax then
  862. serverHop(getgenv().cheat_vars.servermin, getgenv().cheat_vars.servermax)
  863. end
  864. end
  865. wait(15)
  866. end
  867. end
  868. end)
  869.  
  870. getgenv().player_data["player"].OnTeleport:Connect(function(state)
  871. if state == Enum.TeleportState.Started then
  872. syn.queue_on_teleport(game:HttpGet("https://raw.githubusercontent.com/glof2/thuntgui/main/GUI.lua"))
  873. can_teleport = false
  874. end
  875. if state == Enum.TeleportState.Failed then
  876. can_teleport = true
  877. end
  878. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement