Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.79 KB | None | 0 0
  1. local Plrs = game:GetService("Players")
  2. local Run = game:GetService("RunService")
  3. local Rep = game:GetService("ReplicatedStorage")
  4. local Input = game:GetService("UserInputService")
  5. local CoreGui = game:GetService("CoreGui")
  6. local MyPlr = Plrs.LocalPlayer
  7. local MyGui = MyPlr.PlayerGui
  8. local MyPack = MyPlr.Backpack
  9. local MyCoins = MyPlr.leaderstats.Coins
  10. local MyChar = MyPlr.Character
  11. local Events = Rep.Events
  12.  
  13. local On = false
  14. local DigSiteAboutToCollapse = false
  15.  
  16. local Shovels = {
  17. ["Bucket"] = nil,
  18. ["Spade"] = 100,
  19. ["Toy Shovel"] = 250,
  20. ["Small Shovel"] = 600,
  21. ["Medium Shovel"] = 2100,
  22. ["Large Shovel"] = 8800,
  23. ["Big Scooper"] = 24000,
  24. ["Vacuum"] = 65000,
  25. ["Giant Shovel"] = 250000,
  26. ["Metal Detector"] = 500000,
  27. ["Jack Hammer"] = 3000000,
  28. ["Golden Spoon"] = 10000000
  29. }
  30.  
  31. local Backpacks = {
  32. ["Starterpack"] = nil,
  33. ["Small Bag"] = 150,
  34. ["Medium Bag"] = 375,
  35. ["Large Bag"] = 900,
  36. ["XL Bag"] = 3150,
  37. ["XXL Bag"] = 13200,
  38. ["Sand Safe"] = 150000,
  39. ["Sand Vault"] = 350000,
  40. ["Small Canister"] = 1500000,
  41. ["Medium Canister"] = 4000000,
  42. ["Large Canister"] = 8000000,
  43. ["Infinite"] = nil
  44. }
  45.  
  46. local EquipedShovel = "Bucket"
  47. local EquipedBackpack = "Starterpack"
  48.  
  49. local SelectedShovel = "Bucket"
  50. local SelectedBackpack = "Starterpack"
  51.  
  52.  
  53.  
  54. function BackpackFull()
  55. local FindBackpack = MyChar:FindFirstChild(EquipedBackpack)
  56. if FindBackpack then
  57. local GUI = FindBackpack.Counter.SurfaceGui.TextLabel
  58. local CurSand, MaxSand = string.match(GUI.Text, "(%d+)/(%d+)")
  59. if tonumber(CurSand) >= tonumber(MaxSand) then
  60. print("BACKPACK FULL")
  61. return true
  62. else
  63. return false
  64. end
  65. end
  66.  
  67. return false
  68. end
  69.  
  70.  
  71. function EquipTool(Tool)
  72. local Find = MyPack:FindFirstChild(Tool)
  73. if not Find then
  74. Events.EquipShovel:FireServer(Tool)
  75. Find = MyPack:FindFirstChild(Tool)
  76. if Find then
  77. Find.Parent = MyChar
  78. end
  79. else
  80. Find.Parent = MyChar
  81. end
  82. end
  83.  
  84. function EquipBackpack(Item)
  85. Events.EquipBackpack:FireServer(Item)
  86. end
  87.  
  88. function UnEquipTool(Tool)
  89. local Find = MyChar:FindFirstChild(Tool)
  90. if Find then
  91. Find.Parent = MyPack
  92. end
  93. end
  94.  
  95. function BuyToolBackpack(Item, IsATool)
  96. local Table = nil
  97.  
  98. if IsATool then Table = Shovels else Table = Backpacks end
  99.  
  100. local OwnsItem = Events.CheckIfOwned:InvokeServer(Item)
  101. if not OwnsItem then
  102. if IsATool then
  103. if MyCoins.Value >= Shovels[Item] then
  104. Events.Checkout:FireServer(Item)
  105. EquipTool(Item)
  106. EquipedShovel = Item
  107. else
  108. return nil
  109. end
  110. else
  111. if MyCoins.Value >= Backpacks[Item] then
  112. Events.Checkout:FireServer(Item)
  113. EquipBackpack(Item)
  114. else
  115. return nil
  116. end
  117. end
  118. else
  119. if IsATool then
  120. EquipTool(Item)
  121. EquipedShovel = Item
  122. else
  123. EquipBackpack(Item)
  124. end
  125. end
  126. end
  127.  
  128. function MineSandBlock(Block, Tool)
  129. local FindHealth = Block:FindFirstChild("Health")
  130. if Block.Material == Enum.Material.Plastic then
  131. Tool.RemoteClick:FireServer(Block)
  132. end
  133.  
  134. if FindHealth then
  135. for i = 0, (FindHealth.Value + 1) do
  136. Tool.Parent = MyChar
  137. if BackpackFull() then break end
  138. Tool.RemoteClick:FireServer(Block)
  139. Run.RenderStepped:wait()
  140. end
  141. else
  142. return
  143. end
  144. end
  145.  
  146. function Init()
  147. -- Objects
  148.  
  149. local TreasureHuntGUI = Instance.new("ScreenGui")
  150. local MainFrame = Instance.new("Frame")
  151. local title = Instance.new("TextLabel")
  152. local design = Instance.new("Frame")
  153. local buttons = Instance.new("Frame")
  154. local toolSelectionFrame = Instance.new("Frame")
  155. local toolSelectionText = Instance.new("TextLabel")
  156. local toolSelectionRight_B = Instance.new("ImageButton")
  157. local toolSelectionLeft_B = Instance.new("ImageButton")
  158. local backpackSelectionFrame = Instance.new("Frame")
  159. local backpackSelectionText = Instance.new("TextLabel")
  160. local backpackSelectionRight_B = Instance.new("ImageButton")
  161. local backpackSelectionLeft_B = Instance.new("ImageButton")
  162. local buyequiptoolbackpack_B = Instance.new("TextButton")
  163. local toggleautomine_B = Instance.new("TextButton")
  164.  
  165. -- Properties
  166.  
  167. TreasureHuntGUI.Name = "TreasureHuntGUI"
  168. TreasureHuntGUI.Parent = CoreGui
  169. TreasureHuntGUI.ResetOnSpawn = false
  170.  
  171. MainFrame.Name = "MainFrame"
  172. MainFrame.Parent = TreasureHuntGUI
  173. MainFrame.Active = true
  174. MainFrame.BackgroundColor3 = Color3.new(0.164706, 0.172549, 0.192157)
  175. MainFrame.BorderSizePixel = 0
  176. MainFrame.Draggable = true
  177. MainFrame.LayoutOrder = 2
  178. MainFrame.Position = UDim2.new(0.5, -150, 0.5, -105)
  179. MainFrame.Size = UDim2.new(0, 300, 0, 210)
  180.  
  181. title.Name = "title"
  182. title.Parent = MainFrame
  183. title.BackgroundColor3 = Color3.new(1, 1, 1)
  184. title.BackgroundTransparency = 1
  185. title.Size = UDim2.new(1, 0, 0, 40)
  186. title.Font = Enum.Font.SourceSansBold
  187. title.Text = "Treasure Hunt Simulator Exploit \nby Racist Dolphin#5199"
  188. title.TextColor3 = Color3.new(1, 1, 1)
  189. title.TextSize = 14
  190.  
  191. design.Name = "design"
  192. design.Parent = MainFrame
  193. design.BackgroundColor3 = Color3.new(0.258824, 0.270588, 0.286275)
  194. design.BorderSizePixel = 0
  195. design.Position = UDim2.new(0, 5, 0, 45)
  196. design.Size = UDim2.new(1, -10, 0, 1)
  197.  
  198. buttons.Name = "buttons"
  199. buttons.Parent = MainFrame
  200. buttons.BackgroundColor3 = Color3.new(1, 1, 1)
  201. buttons.BackgroundTransparency = 1
  202. buttons.Position = UDim2.new(0, 10, 0, 50)
  203. buttons.Size = UDim2.new(1, -20, 1, -60)
  204.  
  205. toolSelectionFrame.Name = "toolSelectionFrame"
  206. toolSelectionFrame.Parent = buttons
  207. toolSelectionFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  208. toolSelectionFrame.BackgroundTransparency = 1
  209. toolSelectionFrame.Size = UDim2.new(1, 0, 0, 40)
  210.  
  211. toolSelectionText.Name = "toolSelectionText"
  212. toolSelectionText.Parent = toolSelectionFrame
  213. toolSelectionText.BackgroundColor3 = Color3.new(0.282353, 0.294118, 0.317647)
  214. toolSelectionText.BorderSizePixel = 0
  215. toolSelectionText.Position = UDim2.new(0.5, -85, 0.5, -15)
  216. toolSelectionText.Size = UDim2.new(0, 170, 0, 30)
  217. toolSelectionText.Font = Enum.Font.SourceSans
  218. toolSelectionText.Text = SelectedShovel .. " ($" .. tostring(Shovels[SelectedShovel]) .. ")"
  219. toolSelectionText.TextColor3 = Color3.new(0.694118, 0.705882, 0.72549)
  220. toolSelectionText.TextSize = 18
  221.  
  222. toolSelectionRight_B.Name = "toolSelectionRight_B"
  223. toolSelectionRight_B.Parent = toolSelectionFrame
  224. toolSelectionRight_B.BackgroundColor3 = Color3.new(1, 1, 1)
  225. toolSelectionRight_B.BackgroundTransparency = 1
  226. toolSelectionRight_B.Position = UDim2.new(1, -35, 0.5, -15)
  227. toolSelectionRight_B.Size = UDim2.new(0, 30, 0, 30)
  228. toolSelectionRight_B.Image = "rbxassetid://1380733312"
  229. toolSelectionRight_B.ImageColor3 = Color3.new(0.494118, 0.501961, 0.517647)
  230.  
  231. toolSelectionLeft_B.Name = "toolSelectionLeft_B"
  232. toolSelectionLeft_B.Parent = toolSelectionFrame
  233. toolSelectionLeft_B.BackgroundColor3 = Color3.new(1, 1, 1)
  234. toolSelectionLeft_B.BackgroundTransparency = 1
  235. toolSelectionLeft_B.Position = UDim2.new(0, 5, 0.5, -15)
  236. toolSelectionLeft_B.Size = UDim2.new(0, 30, 0, 30)
  237. toolSelectionLeft_B.Image = "rbxassetid://1380733079"
  238. toolSelectionLeft_B.ImageColor3 = Color3.new(0.494118, 0.501961, 0.517647)
  239.  
  240. backpackSelectionFrame.Name = "backpackSelectionFrame"
  241. backpackSelectionFrame.Parent = buttons
  242. backpackSelectionFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  243. backpackSelectionFrame.BackgroundTransparency = 1
  244. backpackSelectionFrame.Position = UDim2.new(0, 0, 0, 40)
  245. backpackSelectionFrame.Size = UDim2.new(1, 0, 0, 40)
  246.  
  247. backpackSelectionText.Name = "backpackSelectionText"
  248. backpackSelectionText.Parent = backpackSelectionFrame
  249. backpackSelectionText.BackgroundColor3 = Color3.new(0.282353, 0.294118, 0.317647)
  250. backpackSelectionText.BorderSizePixel = 0
  251. backpackSelectionText.Position = UDim2.new(0.5, -85, 0.5, -15)
  252. backpackSelectionText.Size = UDim2.new(0, 170, 0, 30)
  253. backpackSelectionText.Font = Enum.Font.SourceSans
  254. backpackSelectionText.Text = SelectedBackpack .. " ($" .. tostring(Backpacks[SelectedBackpack]) .. ")"
  255. backpackSelectionText.TextColor3 = Color3.new(0.694118, 0.705882, 0.72549)
  256. backpackSelectionText.TextSize = 18
  257.  
  258. backpackSelectionRight_B.Name = "backpackSelectionRight_B"
  259. backpackSelectionRight_B.Parent = backpackSelectionFrame
  260. backpackSelectionRight_B.BackgroundColor3 = Color3.new(1, 1, 1)
  261. backpackSelectionRight_B.BackgroundTransparency = 1
  262. backpackSelectionRight_B.Position = UDim2.new(1, -35, 0.5, -15)
  263. backpackSelectionRight_B.Size = UDim2.new(0, 30, 0, 30)
  264. backpackSelectionRight_B.Image = "rbxassetid://1380733312"
  265. backpackSelectionRight_B.ImageColor3 = Color3.new(0.494118, 0.501961, 0.517647)
  266.  
  267. backpackSelectionLeft_B.Name = "backpackSelectionLeft_B"
  268. backpackSelectionLeft_B.Parent = backpackSelectionFrame
  269. backpackSelectionLeft_B.BackgroundColor3 = Color3.new(1, 1, 1)
  270. backpackSelectionLeft_B.BackgroundTransparency = 1
  271. backpackSelectionLeft_B.Position = UDim2.new(0, 5, 0.5, -15)
  272. backpackSelectionLeft_B.Size = UDim2.new(0, 30, 0, 30)
  273. backpackSelectionLeft_B.Image = "rbxassetid://1380733079"
  274. backpackSelectionLeft_B.ImageColor3 = Color3.new(0.494118, 0.501961, 0.517647)
  275.  
  276. buyequiptoolbackpack_B.Name = "buyequiptoolbackpack_B"
  277. buyequiptoolbackpack_B.Parent = buttons
  278. buyequiptoolbackpack_B.BackgroundColor3 = Color3.new(0.282353, 0.294118, 0.317647)
  279. buyequiptoolbackpack_B.BorderSizePixel = 0
  280. buyequiptoolbackpack_B.Position = UDim2.new(0, 0, 0, 85)
  281. buyequiptoolbackpack_B.Size = UDim2.new(1, 0, 0, 30)
  282. buyequiptoolbackpack_B.Font = Enum.Font.SourceSansBold
  283. buyequiptoolbackpack_B.Text = "Buy & Equip Tool/Backpack"
  284. buyequiptoolbackpack_B.TextColor3 = Color3.new(0.694118, 0.705882, 0.72549)
  285. buyequiptoolbackpack_B.TextSize = 18
  286.  
  287. toggleautomine_B.Name = "toggleautomine_B"
  288. toggleautomine_B.Parent = buttons
  289. toggleautomine_B.BackgroundColor3 = Color3.new(0.282353, 0.294118, 0.317647)
  290. toggleautomine_B.BorderSizePixel = 0
  291. toggleautomine_B.Position = UDim2.new(0, 0, 0, 120)
  292. toggleautomine_B.Size = UDim2.new(1, 0, 0, 30)
  293. toggleautomine_B.Font = Enum.Font.SourceSansBold
  294. toggleautomine_B.Text = "Toggle Auto Mine"
  295. toggleautomine_B.TextColor3 = Color3.new(0.694118, 0.705882, 0.72549)
  296. toggleautomine_B.TextSize = 18
  297.  
  298. toolSelectionRight_B.MouseButton1Click:connect(function()
  299. if SelectedShovel == "Bucket" then
  300. SelectedShovel = "Spade"
  301. elseif SelectedShovel == "Spade" then
  302. SelectedShovel = "Toy Shovel"
  303. elseif SelectedShovel == "Toy Shovel" then
  304. SelectedShovel = "Small Shovel"
  305. elseif SelectedShovel == "Small Shovel" then
  306. SelectedShovel = "Medium Shovel"
  307. elseif SelectedShovel == "Medium Shovel" then
  308. SelectedShovel = "Large Shovel"
  309. elseif SelectedShovel == "Large Shovel" then
  310. SelectedShovel = "Big Scooper"
  311. elseif SelectedShovel == "Big Scooper" then
  312. SelectedShovel = "Vacuum"
  313. elseif SelectedShovel == "Vacuum" then
  314. SelectedShovel = "Giant Shovel"
  315. elseif SelectedShovel == "Giant Shovel" then
  316. SelectedShovel = "Metal Detector"
  317. elseif SelectedShovel == "Metal Detector" then
  318. SelectedShovel = "Jack Hammer"
  319. elseif SelectedShovel == "Jack Hammer" then
  320. SelectedShovel = "Golden Spoon"
  321. elseif SelectedShovel == "Golden Spoon" then
  322. SelectedShovel = "Bucket"
  323. end
  324.  
  325. toolSelectionText.Text = SelectedShovel .. " ($" .. tostring(Shovels[SelectedShovel]) .. ")"
  326. end)
  327.  
  328. toolSelectionLeft_B.MouseButton1Click:connect(function()
  329. if SelectedShovel == "Bucket" then
  330. SelectedShovel = "Golden Spoon"
  331. elseif SelectedShovel == "Golden Spoon" then
  332. SelectedShovel = "Jack Hammer"
  333. elseif SelectedShovel == "Jack Hammer" then
  334. SelectedShovel = "Metal Detector"
  335. elseif SelectedShovel == "Metal Detector" then
  336. SelectedShovel = "Giant Shovel"
  337. elseif SelectedShovel == "Giant Shovel" then
  338. SelectedShovel = "Vacuum"
  339. elseif SelectedShovel == "Vacuum" then
  340. SelectedShovel = "Big Scooper"
  341. elseif SelectedShovel == "Big Scooper" then
  342. SelectedShovel = "Large Shovel"
  343. elseif SelectedShovel == "Large Shovel" then
  344. SelectedShovel = "Medium Shovel"
  345. elseif SelectedShovel == "Medium Shovel" then
  346. SelectedShovel = "Small Shovel"
  347. elseif SelectedShovel == "Small Shovel" then
  348. SelectedShovel = "Toy Shovel"
  349. elseif SelectedShovel == "Toy Shovel" then
  350. SelectedShovel = "Spade"
  351. elseif SelectedShovel == "Spade" then
  352. SelectedShovel = "Bucket"
  353. end
  354.  
  355. toolSelectionText.Text = SelectedShovel .. " ($" .. tostring(Shovels[SelectedShovel]) .. ")"
  356. end)
  357.  
  358. backpackSelectionRight_B.MouseButton1Click:connect(function()
  359. if SelectedBackpack == "Starterpack" then
  360. SelectedBackpack = "Small Bag"
  361. elseif SelectedBackpack == "Small Bag" then
  362. SelectedBackpack = "Medium Bag"
  363. elseif SelectedBackpack == "Medium Bag" then
  364. SelectedBackpack = "Large Bag"
  365. elseif SelectedBackpack == "Large Bag" then
  366. SelectedBackpack = "XL Bag"
  367. elseif SelectedBackpack == "XL Bag" then
  368. SelectedBackpack = "XXL Bag"
  369. elseif SelectedBackpack == "XXL Bag" then
  370. SelectedBackpack = "Sand Safe"
  371. elseif SelectedBackpack == "Sand Safe" then
  372. SelectedBackpack = "Sand Vault"
  373. elseif SelectedBackpack == "Sand Vault" then
  374. SelectedBackpack = "Small Canister"
  375. elseif SelectedBackpack == "Small Canister" then
  376. SelectedBackpack = "Medium Canister"
  377. elseif SelectedBackpack == "Medium Canister" then
  378. SelectedBackpack = "Large Canister"
  379. elseif SelectedBackpack == "Large Canister" then
  380. SelectedBackpack = "Infinite"
  381. elseif SelectedBackpack == "Infinite" then
  382. SelectedBackpack = "Starterpack"
  383. end
  384.  
  385. backpackSelectionText.Text = SelectedBackpack .. " ($" .. tostring(Backpacks[SelectedBackpack]) .. ")"
  386. end)
  387.  
  388. backpackSelectionLeft_B.MouseButton1Click:connect(function()
  389. if SelectedBackpack == "Starterpack" then
  390. SelectedBackpack = "Infinite"
  391. elseif SelectedBackpack == "Infinite" then
  392. SelectedBackpack = "Large Canister"
  393. elseif SelectedBackpack == "Large Canister" then
  394. SelectedBackpack = "Medium Canister"
  395. elseif SelectedBackpack == "Medium Canister" then
  396. SelectedBackpack = "Small Canister"
  397. elseif SelectedBackpack == "Small Canister" then
  398. SelectedBackpack = "Sand Vault"
  399. elseif SelectedBackpack == "Sand Vault" then
  400. SelectedBackpack = "Sand Safe"
  401. elseif SelectedBackpack == "Sand Safe" then
  402. SelectedBackpack = "XXL Bag"
  403. elseif SelectedBackpack == "XXL Bag" then
  404. SelectedBackpack = "XL Bag"
  405. elseif SelectedBackpack == "XL Bag" then
  406. SelectedBackpack = "Large Bag"
  407. elseif SelectedBackpack == "Large Bag" then
  408. SelectedBackpack = "Medium Bag"
  409. elseif SelectedBackpack == "Medium Bag" then
  410. SelectedBackpack = "Small Bag"
  411. elseif SelectedBackpack == "Small Bag" then
  412. SelectedBackpack = "Starterpack"
  413. end
  414.  
  415. backpackSelectionText.Text = SelectedBackpack .. " ($" .. tostring(Backpacks[SelectedBackpack]) .. ")"
  416. end)
  417.  
  418. buyequiptoolbackpack_B.MouseButton1Click:connect(function()
  419. BuyToolBackpack(SelectedShovel, true)
  420. BuyToolBackpack(SelectedBackpack, false)
  421. end)
  422.  
  423. toggleautomine_B.MouseButton1Click:connect(function()
  424. On = not On
  425. if On then
  426. toggleautomine_B.BackgroundColor3 = Color3.new(0, 116 / 255, 4 / 255)
  427. else
  428. toggleautomine_B.BackgroundColor3 = Color3.new(72 / 255, 75 / 255, 81 / 255)
  429. end
  430. end)
  431. end
  432.  
  433. Init()
  434.  
  435. Run:BindToRenderStep("HAX", Enum.RenderPriority.First.Value - 1, function()
  436. MyChar = MyPlr.Character
  437. if not On or workspace.Settings.Closed.Value then return end
  438.  
  439. local MyTor = MyChar:FindFirstChild("HumanoidRootPart")
  440. if MyTor then
  441. MyTor.CFrame = CFrame.new(Vector3.new(-33.463, 20.608, -13.357))
  442. end
  443.  
  444. local Tool = MyChar:FindFirstChild(EquipedShovel)
  445. if not Tool then
  446. EquipTool(EquipedShovel)
  447. else
  448. local PickABlock = workspace.SandBlocks:GetChildren()[math.random(1, #workspace.SandBlocks:GetChildren())]
  449. if PickABlock.Material == Enum.Material.Plastic or PickABlock.Material == Enum.Material.Sand then
  450. MineSandBlock(PickABlock, Tool)
  451. end
  452. end
  453. end)
  454.  
  455. workspace.SandBlocks.ChildAdded:connect(function(Obj)
  456. if not On or workspace.Settings.Closed.Value then return end
  457.  
  458. local Tool = MyChar:FindFirstChild(EquipedShovel)
  459. if not Tool then
  460. EquipTool(EquipedShovel)
  461. else
  462. if Obj.Material == Enum.Material.Plastic then
  463. MineSandBlock(Obj, Tool)
  464. end
  465. end
  466. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement