PRO_GAMER_ROBLOX

Mineshaft Tycoon AUTO FARM [OPEN SOURCE]

Jun 28th, 2021
1,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.94 KB | None | 0 0
  1. --// Settings \\--
  2. local Settings = {
  3.     Enabled = false,
  4.     Rebirth = false,
  5.     Speed = 1
  6. }
  7.  
  8. --// Services \\--
  9. local Players = game:GetService("Players")
  10. local Workspace = game:GetService("Workspace")
  11. local RunService = game:GetService("RunService")
  12. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  13.  
  14. --// Variables \\--
  15. local Player = Players.LocalPlayer
  16. local Stats = {
  17.     Inventory = Player:WaitForChild("Stats"):WaitForChild("Inventory"),
  18.     Space = Player.Stats:WaitForChild("InventorySpace"),
  19.     Rebirths = Player:WaitForChild("leaderstats"):WaitForChild("Life")
  20. }
  21. local Tycoon = nil
  22.  
  23. --// Grab Player Tycoon \\--
  24. for _, A_1 in next, Workspace:WaitForChild("Tycoon"):WaitForChild("Tycoons"):GetChildren() do
  25.     if A_1.Owner.Value == Player then
  26.         Tycoon = A_1
  27.         break
  28.     end
  29. end
  30. if Tycoon == nil then
  31.     return
  32. end
  33.  
  34. --// UI Library \\--
  35. local Library = loadstring(game:HttpGetAsync('https://pastebin.com/raw/edJT9EGX'))()
  36. local Window_1 = Library:CreateWindow("Miner by Ezpi")
  37. Window_1:AddToggle({
  38.     text = 'Enabled',
  39.     callback = function(A_1)
  40.         Settings.Enabled = A_1
  41.     end
  42. })
  43. Window_1:AddToggle({
  44.     text = 'Auto Rebirth',
  45.     callback = function(A_1)
  46.         Settings.Rebirth = A_1
  47.     end
  48. })
  49. Window_1:AddSlider({
  50.     text = 'Speed',
  51.     min = 1,
  52.     max = 16,
  53.     callback = function(A_1)
  54.         Settings.Speed = A_1
  55.     end
  56. })
  57. Library:Init()
  58.  
  59. --// NoClip \\--
  60. RunService.RenderStepped:Connect(function()
  61.     if Settings.Enabled then
  62.         Player.Character.Humanoid:ChangeState(11)
  63.     end
  64. end)
  65.  
  66. --// Get Most Valuable Ore \\--
  67. function GetOre()
  68.     local Ore = nil
  69.     local Value = 0
  70.  
  71.     for _, A_1 in next, Tycoon:WaitForChild("Essentials"):WaitForChild("Ores"):GetChildren() do
  72.         if A_1:FindFirstChild("Cash") and A_1.Cash.Value > Value and A_1:FindFirstChild("Part") then
  73.             Ore = A_1
  74.             Value = A_1.Cash.Value
  75.         end
  76.     end
  77.  
  78.     return Ore
  79. end
  80.  
  81. --// Script \\--
  82. while wait() do
  83.     if Settings.Enabled then
  84.         local Ore = GetOre()
  85.         if Ore ~= nil and Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") then
  86.             repeat
  87.                 wait()
  88.                 pcall(function()
  89.                     Player.Character.HumanoidRootPart.CFrame = Ore.Part.CFrame * CFrame.Angles(0,math.rad(math.random(-180,180)),0)
  90.                     for _ = 1, Settings.Speed do
  91.                         ReplicatedStorage.Ore:FireServer(Ore.Cash.Value, Ore.Part)
  92.                     end
  93.                 end)
  94.             until Stats.Inventory.Value >= Stats.Space.Value or Settings.Enabled == false
  95.  
  96.             if Settings.Enabled == true then
  97.                 ReplicatedStorage.Sell:FireServer()
  98.  
  99.                 if Settings.Rebirth == true and Stats.Rebirths.Value < 10 then
  100.                     ReplicatedStorage.Rebirth:FireServer()
  101.                 end
  102.             end
  103.         end
  104.     end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment