Advertisement
trixade

Untitled

Oct 9th, 2021
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.61 KB | None | 0 0
  1. local SELL_TRESHOLD = nil -- ONLY CHANGE THIS IF YOU HAVE INF BACKPACK.
  2.  
  3. local LocalPlayer = game.Players.LocalPlayer
  4. local Rebirths = LocalPlayer.leaderstats.Rebirths
  5.  
  6. print("Loading Mining Simulator GUI")
  7. local OldGui = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Nice Flex But OK")
  8. if OldGui then
  9.     OldGui:Destroy()
  10. end
  11.  
  12. local ScreenGUI = game:GetObjects("rbxassetid://4835603667")[1]
  13. ScreenGUI.Enabled = true
  14. ScreenGUI.Parent = LocalPlayer.PlayerGui
  15. ScreenGUI.Name = "Nice Flex But OK"
  16.  
  17. local TopBar = ScreenGUI.Frame
  18. local MainFrame = TopBar.Frame
  19. local ExitButton = TopBar.ExitButton
  20. local OpenButton = TopBar.Parent.OpenButton
  21.  
  22. local AutoSellToggle = MainFrame.AutoSellToggle
  23. local FastMineToggle = MainFrame.FastMineToggle
  24. local AutoMineToggle = MainFrame.AutoMineToggle
  25. local AutoBackpackToggle = MainFrame.AutoBackpackToggle
  26. local AutoToolsToggle = MainFrame.AutoToolsToggle
  27. local AutoRebirthToggle = MainFrame.AutoRebirthToggle
  28.  
  29. local Remote = game.ReplicatedStorage.Network:InvokeServer()
  30.  
  31. local Toggles = {
  32.     AutoSell = false,
  33.     FastMine = false,
  34.     AutoMine = false,
  35.     AutoBackpack = false,
  36.     AutoTools = false,
  37.     AutoRebirth = false
  38. }
  39.  
  40. local InventoryAmount = LocalPlayer.PlayerGui.ScreenGui.StatsFrame2.Inventory.Amount
  41. local CoinsAmount = game.Players.LocalPlayer.leaderstats.Coins
  42.  
  43. local function GetCoinsAmount()
  44.     local Amount = CoinsAmount.Value
  45.     Amount = Amount:gsub(',', '')
  46.  
  47.     return tonumber(Amount)
  48. end
  49.  
  50. local function GetInventoryAmount()
  51.     local Amount = InventoryAmount.Text
  52.     local Amount2 = InventoryAmount.Text
  53.     Amount = Amount:gsub('%s+', '')
  54.     Amount2 = Amount2:gsub('%s+', '')
  55.     Amount = Amount:gsub(',', '')
  56.  
  57.     local stringTable = Amount:split("/")
  58.     local stringTable2 = Amount2:split("/")
  59.     return tonumber(stringTable[1]), tonumber(stringTable[2]), stringTable2[1], stringTable2[2]
  60. end
  61.  
  62. local Remote = game.ReplicatedStorage.Network:InvokeServer()
  63.  
  64. local Blocks = game.Workspace.Blocks
  65.  
  66. AutoMineToggle.MouseButton1Click:Connect(function()
  67.     if Remote then
  68.         Toggles["AutoMine"] = not Toggles["AutoMine"]
  69.         if Toggles["AutoMine"] == true then
  70.             AutoMineToggle.Text = "Disable"
  71.             while Toggles["AutoMine"] do
  72.                 local Character = LocalPlayer.Character
  73.                 local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
  74.                 if HumanoidRootPart then
  75.                     local min = HumanoidRootPart.CFrame + Vector3.new(-10,-10,-10)
  76.                     local max = HumanoidRootPart.CFrame + Vector3.new(10,10,10)
  77.                     local region = Region3.new(min.Position, max.Position)
  78.                     local parts = workspace:FindPartsInRegion3WithWhiteList(region, {game.Workspace.Blocks}, 100) --  ignore part
  79.  
  80.                     for each, block in pairs(parts) do
  81.                         if block:IsA("BasePart") then
  82.                             local BlockModel = block.Parent
  83.                             Remote:FireServer("MineBlock",{{BlockModel}})
  84.                             wait()
  85.                         end
  86.                     end
  87.                 end
  88.                 if not ScreenGUI then
  89.                     break
  90.                 end
  91.                 wait()
  92.             end
  93.         else
  94.             AutoMineToggle.Text = "Enable"
  95.         end
  96.     end
  97. end)
  98. AutoRebirthToggle.MouseButton1Click:Connect(function()
  99.     if Remote then
  100.         Toggles["AutoRebirth"] = not Toggles["AutoRebirth"]
  101.         if Toggles["AutoRebirth"] == true then
  102.             AutoRebirthToggle.Text = "Disable"
  103.         else
  104.             AutoRebirthToggle.Text = "Enable"
  105.         end
  106.     end
  107. end)
  108. AutoBackpackToggle.MouseButton1Click:Connect(function()
  109.     if Remote then
  110.         Toggles["AutoBackpack"] = not Toggles["AutoBackpack"]
  111.         if Toggles["AutoBackpack"] == true then
  112.             AutoBackpackToggle.Text = "Disable"
  113.         else
  114.             AutoBackpackToggle.Text = "Enable"
  115.         end
  116.     end
  117. end)
  118. AutoToolsToggle.MouseButton1Click:Connect(function()
  119.     if Remote then
  120.         Toggles["AutoTools"] = not Toggles["AutoTools"]
  121.         if Toggles["AutoTools"] == true then
  122.             AutoToolsToggle.Text = "Disable"
  123.         else
  124.             AutoToolsToggle.Text = "Enable"
  125.         end
  126.     end
  127. end)
  128. AutoSellToggle.MouseButton1Click:Connect(function()
  129.     if Remote then
  130.         Toggles["AutoSell"] = not Toggles["AutoSell"]
  131.         if Toggles["AutoSell"] == true then
  132.             AutoSellToggle.Text = "Disable"
  133.         else
  134.             AutoSellToggle.Text = "Enable"
  135.         end
  136.     end
  137. end)
  138. FastMineToggle.MouseButton1Click:Connect(function()
  139.     if Remote then
  140.         Toggles["FastMine"] = not Toggles["FastMine"]
  141.         if Toggles["FastMine"] == true then
  142.             FastMineToggle.Text = "Disable"
  143.             for each, block in pairs(game.Workspace.Blocks:GetChildren()) do
  144.                 local Stats = block:FindFirstChild("Stats")
  145.                 if Stats then
  146.                     local Multiplier = Stats:FindFirstChild("Multiplier")
  147.                     if Multiplier then
  148.                         local ActualMultiplier = Stats:FindFirstChild("ActualMultiplier")
  149.                         if not ActualMultiplier then
  150.                             local ActualMultiplier = Multiplier:Clone()
  151.                             ActualMultiplier.Name = "ActualMultiplier"
  152.                             ActualMultiplier.Parent = Stats
  153.                         end
  154.                         Multiplier.Value = -1337
  155.                     end
  156.                 end
  157.             end
  158.         else
  159.             FastMineToggle.Text = "Enable"
  160.  
  161.             for each, block in pairs(game.Workspace.Blocks:GetChildren()) do
  162.                 local Stats = block:FindFirstChild("Stats")
  163.                 if Stats then
  164.                     local Multiplier = Stats:FindFirstChild("Multiplier")
  165.                     if Multiplier then
  166.                         local ActualMultiplier = Stats:FindFirstChild("ActualMultiplier")
  167.                         if ActualMultiplier then
  168.                             Multiplier.Value = ActualMultiplier.Value
  169.                         end
  170.                     end
  171.                 end
  172.             end
  173.         end
  174.     end
  175. end)
  176. CoinsAmount.Changed:Connect(function(Change)
  177.     if ScreenGUI then
  178.         if Toggles["AutoRebirth"] then
  179.             local Amount = GetCoinsAmount()
  180.             if Amount >= (10000000 * (Rebirths.Value + 1)) then
  181.                 Remote:FireServer("Rebirth",{{                                  }})
  182.             end
  183.         end
  184.         if Toggles["AutoBackpack"] then
  185.             for i = 3, 50 do
  186.                 Remote:FireServer("BuyItem",{{"Backpack",i}})
  187.                 wait(0.1)          
  188.             end
  189.         end
  190.         if Toggles["AutoTools"] then
  191.             for i = 1, 50 do
  192.                 Remote:FireServer("BuyItem",{{"Tools",i}})
  193.                 wait(0.1)          
  194.             end
  195.         end
  196.     end
  197. end)
  198.  
  199. InventoryAmount.Changed:Connect(function(Change)
  200.     if ScreenGUI then
  201.         if Change == "Text" then
  202.             if Toggles["AutoSell"] then
  203.                 local Amount, MaxAmount, AmountComma, MaxAmountComma2 = GetInventoryAmount()
  204.                 if SELL_TRESHOLD ~= nil then
  205.                     MaxAmount = SELL_TRESHOLD
  206.                 end
  207.                 if Amount >= MaxAmount then
  208.                     local Character = LocalPlayer.Character
  209.                     if Character then
  210.                         local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
  211.                         if HumanoidRootPart then
  212.                             local SavedLocation = HumanoidRootPart.CFrame
  213.                             local SavedText = InventoryAmount.Text
  214.                             while InventoryAmount.Text == SavedText do
  215.                                 HumanoidRootPart.CFrame = CFrame.new(-116, 13, 38)
  216.                                 Remote:FireServer("SellItems",{{               }})
  217.                                 wait()
  218.                             end
  219.                             HumanoidRootPart.Anchored = true
  220.                             while HumanoidRootPart.CFrame ~= SavedLocation do
  221.                                 HumanoidRootPart.CFrame = SavedLocation
  222.                             wait()
  223.                             end
  224.                             HumanoidRootPart.Anchored = false
  225.                         end
  226.                     end
  227.                 end
  228.             end
  229.         end
  230.     end
  231. end)
  232.  
  233. game.Workspace.Blocks.ChildAdded:Connect(function(block)
  234.     if ScreenGUI then
  235.         if Toggles["FastMine"] then
  236.             local Stats = block:WaitForChild("Stats")
  237.             if Stats then
  238.                 local Multiplier = Stats:WaitForChild("Multiplier")
  239.                 if Multiplier then
  240.                     local ActualMultiplier = Stats:FindFirstChild("ActualMultiplier")
  241.                     if not ActualMultiplier then
  242.                         local ActualMultiplier = Multiplier:Clone()
  243.                         ActualMultiplier.Name = "ActualMultiplier"
  244.                         ActualMultiplier.Parent = Stats
  245.                     end
  246.                     Multiplier.Value = -1337
  247.                 end
  248.             end
  249.         end
  250.     end
  251. end)
  252.  
  253. ExitButton.MouseButton1Click:Connect(function()
  254.     TopBar.Visible = false
  255.     OpenButton.Visible = true
  256. end)
  257.  
  258. OpenButton.MouseButton1Click:Connect(function()
  259.     TopBar.Visible = true
  260.     OpenButton.Visible = false
  261. end)
  262. print("Follow Trush on ytb")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement