Advertisement
HairBaconGamming

Auto Chest Blox Fruits OP Full Source

Aug 11th, 2022 (edited)
3,192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.21 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local VirtualInputManager = game:GetService("VirtualInputManager")
  3. local Material = loadstring(game:HttpGet("https://raw.githubusercontent.com/Kinlei/MaterialLua/master/Module.lua"))()
  4.  
  5. local Hub = Material.Load({
  6.     Title = "Auto Chest",
  7.     Style = 3,
  8.     SizeX = 300,
  9.     SizeY = 300,
  10.     Theme = "Light",
  11.     ColorOverrides = {
  12.         MainFrame = Color3.fromRGB(235,235,235)
  13.     }
  14. })
  15.  
  16. local Home = Hub.New({
  17.     Title = "Home"
  18. })
  19.  
  20. _G.Tween = nil
  21. _G.Play = false
  22. _G.CloseAllScript = false
  23.  
  24. local ToggleAutoChest = Home.Toggle({
  25.     Text = "Auto Chest",
  26.     Callback = function(Value)
  27.         _G.Play = Value
  28.     end,
  29.     Enabled = _G.Play
  30. })
  31.  
  32. game:GetService('RunService').Stepped:connect(function()
  33.     if _G.Play then
  34.         local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
  35.         local Humanoid = Player.Character:WaitForChild("Humanoid")
  36.         HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  37.         for i,v in pairs(Player.Character:GetDescendants()) do
  38.             if v:IsA("BasePart") then
  39.                 v.CanCollide = false
  40.             end
  41.         end
  42.         Humanoid.Sit = false
  43.     end
  44. end)
  45.  
  46. function Tween(Part)
  47.     if _G.Tween then
  48.         _G.Tween:Cancel()
  49.     end
  50.     local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
  51.     _G.Tween = game:GetService("TweenService"):Create(HumanoidRootPart,TweenInfo.new((Part.Position-HumanoidRootPart.Position).magnitude/300,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{CFrame = Part.CFrame})
  52.     _G.Tween:Play()
  53.     local flying = true
  54.     while game:GetService("RunService").Stepped:Wait() and flying and _G.Play do
  55.         if _G.Play == false then
  56.             _G.Tween:Cancel()
  57.         end
  58.         if (Part.Position-HumanoidRootPart.Position).magnitude < 250 then
  59.             _G.Tween:Cancel()
  60.             for i = 1,5 do
  61.                 HumanoidRootPart.CFrame = Part.CFrame
  62.                 wait()
  63.             end
  64.             flying = false
  65.         end
  66.     end
  67. end
  68.  
  69. function TableNearToFarChests()
  70.     local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
  71.     local chests = {}
  72.     local checkedchests = {}
  73.     local function Check(v)
  74.         for i,e in pairs(checkedchests) do
  75.             if v == e then
  76.                 return false
  77.             end
  78.         end
  79.         return true
  80.     end
  81.     local function A(tablec)
  82.         local nearest
  83.         local sus
  84.         for i,v in pairs(tablec) do
  85.             local real = Check(v)
  86.             if real then
  87.                 if nearest then
  88.                     if (v.Position-HumanoidRootPart.Position).magnitude < nearest then
  89.                         nearest = (v.Position-HumanoidRootPart.Position).magnitude
  90.                         sus = v
  91.                     end
  92.                 else
  93.                     nearest = (v.Position-HumanoidRootPart.Position).magnitude
  94.                     sus = v
  95.                 end
  96.             end
  97.         end
  98.         return sus
  99.     end
  100.     local function B(tablec)
  101.         local C = A(tablec)
  102.         if C then
  103.             table.insert(checkedchests,C)
  104.             B(tablec)
  105.         end
  106.         return checkedchests
  107.     end
  108.     for i,v in pairs(workspace:GetDescendants()) do
  109.         if v.Name == "Chest1" or v.Name == "Chest2" or v.Name == "Chest3" then
  110.             table.insert(chests,v)
  111.         end
  112.     end
  113.     B(chests)
  114.     return chests,checkedchests
  115. end
  116.  
  117. repeat wait() until game:IsLoaded()
  118.  
  119. while wait(1) do
  120.     if _G.Play then
  121.         local chests,checkedchests = TableNearToFarChests()
  122.         for i,v in pairs(checkedchests) do
  123.             Tween(v)
  124.             if _G.Play == false then
  125.                 break
  126.             end
  127.         end
  128.     else
  129.         if _G.Tween then
  130.             _G.Tween:Cancel()
  131.         end
  132.     end
  133. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement