Advertisement
CasperYep

[REL] Mining Simulator GUI

Nov 23rd, 2018
29,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.12 KB | None | 0 0
  1. print("Loading Mining Simulator GUI")
  2. local OldGui = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Nice Flex But OK")
  3. if OldGui then
  4.     OldGui:Destroy()
  5. end
  6. local ScreenGUI = game:GetObjects("rbxassetid://2594598861")[1]
  7. ScreenGUI.Enabled = true
  8. ScreenGUI.Parent = game.Players.LocalPlayer.PlayerGui
  9. ScreenGUI.Name = "Nice Flex But OK"
  10.  
  11. local TopBar = ScreenGUI.Frame
  12. local MainFrame = TopBar.Frame
  13. local ExitButton = TopBar.ExitButton
  14. local OpenButton = TopBar.Parent.OpenButton
  15.  
  16. local RemoteText = TopBar.RemoteText
  17. local AutoSellToggle = MainFrame.AutoSellToggle
  18. local FastMineToggle = MainFrame.FastMineToggle
  19. local AutoMineToggle = MainFrame.AutoMineToggle
  20. local AutoBackpackToggle = MainFrame.AutoBackpackToggle
  21. local AutoToolsToggle = MainFrame.AutoToolsToggle
  22. local AutoRebirthToggle = MainFrame.AutoRebirthToggle
  23.  
  24. local AutoSellToggled = false
  25. local FastMineToggled = false
  26. local AutoMineToggled = false
  27. local AutoBackpackToggled = false
  28. local AutoToolsToggled = false
  29. local AutoRebirthToggled = false
  30.  
  31. local Remote = nil
  32.  
  33. local backpackModule = require(game.Lighting.Assets.Modules.BackpackModule)
  34.  
  35. local Network = {
  36.     cache = {}
  37. }
  38. local network = {}
  39. local network_mt = {}
  40. function network_mt:__index()
  41.     Network:FireServer("xd")
  42.     error("Read the rules", 2)
  43. end
  44. setmetatable(network, network_mt)
  45. function Network:Initialize()
  46.     local id = 0
  47.     local runs = 0
  48.     function key()
  49.         id = id + 1
  50.         if id > 100 then
  51.             id = 0
  52.         end
  53.         return 2654 * (id * 3)
  54.     end
  55.     function Network.new()
  56.         local remote, func = game.ReplicatedStorage.Network:InvokeServer()
  57.         runs = runs + 1
  58.         if runs >= 2 then
  59.             self:FireServer("KickSelf", "Bypassing Network")
  60.         end
  61.         Network.RemoteEvent = remote
  62.         Network.RemoteFunction = func
  63.     end
  64.     Network.new()
  65.     function Network:FireServer(name, ...)
  66.         self.RemoteEvent:FireServer(name, {
  67.             {
  68.                 ...
  69.             }
  70.         })
  71.     end
  72.     function Network:InvokeServer(name, ...)
  73.         return self.RemoteFunction:InvokeServer(name, {
  74.             {
  75.                 ...
  76.             }
  77.         }, key())
  78.     end
  79.     function self.RemoteFunction.OnClientInvoke(...)
  80.         return self:Function(...)
  81.     end
  82.     self.RemoteEvent.OnClientEvent:connect(function(...)
  83.         self:Function(...)
  84.     end)
  85.     Network.init = true
  86. end
  87. Network:Initialize()
  88.  
  89. local MetaTable = getrawmetatable(game)
  90. local game_namecall = MetaTable.__namecall
  91. pcall((setreadonly or make_writeable), MetaTable, false)
  92.  
  93. MetaTable.__namecall = function(self, ...)
  94. if Remote == nil then
  95.     local args = {...}
  96.     local method = table.remove(args)
  97.     if method == 'FireServer' then
  98.         self.Name = "CorrectRemote"
  99.         Remote = self
  100.         RemoteText.Text = "Remote Found!"
  101.     end
  102. end
  103. return game_namecall(self, ...)
  104. end
  105.  
  106. local function Raycast(Vector)
  107.     local Raycast = Ray.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position, Vector)
  108.     local Ignore = {game.Players.LocalPlayer.Character}
  109.     local Ore, endPoint = game.Workspace:FindPartOnRayWithIgnoreList(Raycast, Ignore)
  110.     if Ore then
  111.         if Ore.Parent.Parent.Name == "Blocks" then
  112.             local Arguments = {
  113.                     [1] = "MineBlock",
  114.                     [2] = {
  115.                         [1] = {
  116.                             [1] = Ore.Parent
  117.                         }
  118.                     }
  119.             }
  120.             Remote:FireServer(unpack(Arguments))
  121.         end
  122.     end
  123. end
  124.  
  125.  
  126. AutoSellToggle.MouseButton1Click:Connect(function()
  127.     if Remote == nil then
  128.     else
  129.         if AutoSellToggled == false then
  130.             AutoSellToggled = true
  131.             AutoSellToggle.Text = "Disable"
  132.             while AutoSellToggled do
  133.                 wait(1)
  134.                 local coins, inventory, equipped, ownedItems, offer, rebirths, skins, skinEquipped, pets, crates, favorites, hatInventory, wearing, visibleHats, eggHuntStuff, eggPackBought, quests, sortType, patriotBought, tokens, permanentItems, login, toolEnchantments, newQuests, lightPack, equippedAccessories, secProgression, trails, candyCorn, hauntedPack, darkPack, visibleAccessory, infernoPack = Network:InvokeServer("GetStats")
  135.                 local function inventoryContents()
  136.                     local num = 0
  137.                     for i = 1, #inventory do
  138.                         num = num + inventory[i][2]
  139.                     end
  140.                     return num
  141.                 end
  142.                 local Amount = inventoryContents()
  143.                 local Backpack = backpackModule[equipped[1]]
  144.                 if Amount == Backpack then
  145.                     local LastPosition = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  146.                     for i = 1, 25 do
  147.                     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(-116, 13, 38)
  148.                    
  149.                     local Arguments = {
  150.                             [1] = "SellItems",
  151.                             [2] = {
  152.                                 [1] = {
  153.                                    
  154.                                 }
  155.                             }
  156.                     }
  157.                    
  158.                     Remote:FireServer(unpack(Arguments))
  159.                     wait(0.03)
  160.                     end
  161.                     for i = 1, 10 do
  162.                     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = LastPosition + Vector3.new(0,2,0)
  163.                     wait(0.03)
  164.                     end
  165.                 end
  166.             end
  167.         else
  168.             AutoSellToggled = false
  169.             AutoSellToggle.Text = "Enable"
  170.         end
  171.     end
  172. end)
  173.  
  174. FastMineToggle.MouseButton1Click:Connect(function()
  175.     if Remote == nil then
  176.     else
  177.         if FastMineToggled == false then
  178.             FastMineToggled = true
  179.             FastMineToggle.Text = "Disable"
  180.             for i,v in pairs(game.Workspace.Blocks:GetChildren()) do
  181.                 if v:FindFirstChild("Stats") then
  182.                     if v:FindFirstChild("Stats"):FindFirstChild("Multiplier") then
  183.                         v.Stats.Multiplier.Value = -1337
  184.                     end
  185.                 end
  186.             end
  187.         else
  188.             FastMineToggled = false
  189.             FastMineToggle.Text = "Enable"
  190.         end
  191.     end
  192. end)
  193.  
  194. AutoMineToggle.MouseButton1Click:Connect(function()
  195.     if Remote == nil then
  196.     else
  197.         if AutoMineToggled == false then
  198.             AutoMineToggled = true
  199.             AutoMineToggle.Text = "Disable"
  200.             while AutoMineToggled do
  201.                 for i = 1, 100 do
  202.                 Raycast(Vector3.new(5, 0, 0))
  203.                 Raycast(Vector3.new(-5, 0, 0))
  204.                 Raycast(Vector3.new(0, 0, 5))
  205.                 Raycast(Vector3.new(0, 0, -5))
  206.                 Raycast(Vector3.new(0, -5, 0))
  207.                 wait(0.1)
  208.                 end
  209.             end
  210.         else
  211.             AutoMineToggled = false
  212.             AutoMineToggle.Text = "Enable"
  213.         end
  214.     end
  215. end)
  216.  
  217. AutoBackpackToggle.MouseButton1Click:Connect(function()
  218.     if Remote == nil then
  219.     else
  220.         if AutoBackpackToggled == false then
  221.             AutoBackpackToggled = true
  222.             AutoBackpackToggle.Text = "Disable"
  223.             while AutoBackpackToggled do
  224.                 wait(3)
  225.                 for i = 1, 50 do
  226.                 if i == 2 then
  227.                 else
  228.                     local Arguments = {
  229.                             [1] = "BuyItem",
  230.                             [2] = {
  231.                                 [1] = {
  232.                                     [1] = "Backpack",
  233.                                     [2] = i
  234.                                 }
  235.                             }
  236.                     }
  237.                     Remote:FireServer(unpack(Arguments))
  238.                     wait(0.1)
  239.                     end            
  240.                 end
  241.             end
  242.         else
  243.             AutoBackpackToggled = false
  244.             AutoBackpackToggle.Text = "Enable"
  245.         end
  246.     end
  247. end)
  248.  
  249. AutoToolsToggle.MouseButton1Click:Connect(function()
  250.     if Remote == nil then
  251.     else
  252.         if AutoToolsToggled == false then
  253.             AutoToolsToggled = true
  254.             AutoToolsToggle.Text = "Disable"
  255.             while AutoToolsToggled do
  256.                 wait(3)
  257.                 for i = 1, 50 do
  258.                 local Arguments = {
  259.                         [1] = "BuyItem",
  260.                         [2] = {
  261.                             [1] = {
  262.                                 [1] = "Tools",
  263.                                 [2] = i
  264.                             }
  265.                         }
  266.                 }
  267.                 Remote:FireServer(unpack(Arguments))
  268.                 wait(0.1)
  269.                 end
  270.             end
  271.         else
  272.             AutoToolsToggled = false
  273.             AutoToolsToggle.Text = "Enable"
  274.         end
  275.     end
  276. end)
  277.  
  278.  
  279. AutoRebirthToggle.MouseButton1Click:Connect(function()
  280.     if Remote == nil then
  281.     else
  282.         if AutoRebirthToggled == false then
  283.             AutoRebirthToggled = true
  284.             AutoRebirthToggle.Text = "Disable"
  285.             while AutoRebirthToggled do
  286.                 wait(0.5)
  287.                 local Arguments = {
  288.                         [1] = "Rebirth",
  289.                         [2] = {
  290.                             [1] = {
  291.                                
  292.                             }
  293.                         }
  294.                 }
  295.                
  296.                 Remote:FireServer(unpack(Arguments))
  297.             end
  298.         else
  299.             AutoRebirthToggled = false
  300.             AutoRebirthToggle.Text = "Enable"
  301.         end
  302.     end
  303. end)
  304.  
  305. ExitButton.MouseButton1Click:Connect(function()
  306.     TopBar.Visible = false
  307.     OpenButton.Visible = true
  308. end)
  309. OpenButton.MouseButton1Click:Connect(function()
  310.     TopBar.Visible = true
  311.     OpenButton.Visible = false
  312. end)
  313.  
  314. game.Workspace.Blocks.ChildAdded:Connect(function(v)
  315.     if FastMineToggled then
  316.         local Stats = v:WaitForChild("Stats")
  317.         local Multiplier = Stats:WaitForChild("Multiplier")
  318.         if Stats and Multiplier then
  319.             Multiplier.Value = -1337
  320.         end
  321.     end
  322. end)
  323.  
  324. print("GUI LOADED")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement