Gerard_games

Delivery Sim

Jun 5th, 2021 (edited)
33,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.10 KB | None | 0 0
  1. --[[
  2.  
  3. Made by Gerard#0001
  4. https://v3rmillion.net/member.php?action=profile&uid=211143
  5. Don't be pp head thx
  6.  
  7. ]]
  8.  
  9. --antiafk lol
  10. local VirtualUser = game:GetService("VirtualUser")
  11.     game:GetService("Players").LocalPlayer.Idled:connect(function()
  12.     VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
  13.     wait(1)
  14.     VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
  15. end)
  16.  
  17. -- Literally just get the Warehouse
  18. local Warehouse = nil
  19. repeat wait(0.1)
  20.     for i,v in pairs(game:GetService("Workspace").GameLogic.Warehouses:GetChildren()) do
  21.         if v.Owner.Value == game.Players.LocalPlayer then
  22.             Warehouse = v
  23.             break
  24.         end
  25.     end
  26. until Warehouse ~= nil
  27.  
  28. --Makes sure that 'Boxes' is part of your character as otherwise it can mess with the script
  29. if not game.Players.LocalPlayer.Character:FindFirstChild("Boxes") then
  30.     repeat wait(0.5)
  31.         if syn then
  32.             messagebox("Please: -Pick up any BOX from your RACK\n-PLACE IT BACK\nFor the script to work!!!\nFailure to do this will make it bug out", "GOD DAMN READ", 0)
  33.         else
  34.             print("Please: -Pick up any BOX from your RACK\n-PLACE IT BACK\nFor the script to work!!!\nFailure to do this will make it bug out")
  35.         end
  36.     until game.Players.LocalPlayer.Character:FindFirstChild("Boxes") and #game.Players.LocalPlayer.Character:FindFirstChild("Boxes"):GetChildren() == 0
  37. end
  38.  
  39. --Collect all a Box
  40. function Box(typeofbox)
  41.     local JackNumber = string.split(game:GetService("Players").LocalPlayer.PlayerGui.Main.Jack.Capacity.Text, "/")
  42.     local JackNumber2 = string.split(game:GetService("Players").LocalPlayer.PlayerGui.Main.Jack.Capacity.Text, "/")
  43.     if _G.Enabled and _G.Stock and tonumber(JackNumber[1]) < tonumber(JackNumber[2]) and tonumber(JackNumber[1]) < CountEmptySpace() then
  44.         repeat wait()
  45.             local Box = nil
  46.             repeat wait()
  47.                 if typeofbox == nil or typeofbox == 'all' or typeofbox == 'All' then
  48.                     Box = game:GetService("Workspace").GameLogic.SpawnedBoxes:GetChildren()[#game:GetService("Workspace").GameLogic.SpawnedBoxes:GetChildren()]
  49.                 else
  50.                     Box = game:GetService("Workspace").GameLogic.SpawnedBoxes:WaitForChild(tostring(typeofbox))
  51.                 end
  52.             until Box ~= nil
  53.             local boxparent = Box.Parent
  54.             JackNumber = string.split(game:GetService("Players").LocalPlayer.PlayerGui.Main.Jack.Capacity.Text, "/")
  55.             JackNumber2 = string.split(game:GetService("Players").LocalPlayer.PlayerGui.Main.Jack.Capacity.Text, "/")
  56.             if _G.Enabled and _G.Stock and tonumber(JackNumber[1]) < tonumber(JackNumber[2]) and tonumber(JackNumber[1]) < CountEmptySpace() then
  57.                 repeat wait()
  58.                     game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = Box.MeshPart.CFrame
  59.                     game:GetService("ReplicatedStorage").Remotes.PickupBox:InvokeServer(Box)
  60.                     JackNumber2 = string.split(game:GetService("Players").LocalPlayer.PlayerGui.Main.Jack.Capacity.Text, "/")
  61.                 until tonumber(JackNumber2[1]) >= tonumber(JackNumber[1]) or tonumber(JackNumber2[1]) >= CountEmptySpace() or Box.Parent ~= boxparent or Box == nil or not _G.Stock or not _G.Enabled
  62.             end
  63.         until tonumber(JackNumber[1]) >= tonumber(JackNumber[2]) or tonumber(JackNumber[1]) >= CountEmptySpace() or not _G.Stock or not _G.Enabled
  64.     end
  65. end
  66.  
  67. --Gets the number of free storage rack spaces
  68. function CountEmptySpace()
  69.     local total = 0
  70.     for i,v in pairs(Warehouse.Racks:GetChildren()) do
  71.         for z,x in pairs(v:GetChildren()) do
  72.             if x.Name == 'PackagePosition' and x:FindFirstChild("Package") and x.Package.Value == nil then
  73.                 total = total + 1
  74.             end
  75.         end
  76.     end
  77.     return total
  78. end
  79.  
  80. --Picks up boxes but with 'sellall' (set sellall to nil or false to only pick up one) as true it will sell every single box (or at least attempt to) that you own
  81. function PickupBox(sellall)
  82.     if _G.Enabled and _G.Deliver then
  83.         for i,v in pairs(Warehouse.Racks:GetChildren()) do
  84.             if _G.Enabled and _G.Deliver then
  85.                 for z,x in pairs(v.Boxes:GetChildren()) do
  86.                     if _G.Enabled and _G.Deliver and game.Players.LocalPlayer.Character:FindFirstChild("Boxes") then
  87.                         local Box = x
  88.                         repeat wait(0.1)
  89.                             game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = Box.Main.CFrame
  90.                             game:GetService("ReplicatedStorage").Remotes.PickupBox:InvokeServer(x)
  91.                         until #game.Players.LocalPlayer.Character.Boxes:GetChildren() ~= 0 or not _G.Enabled or not _G.Stock
  92.                     end
  93.                     if _G.Enabled and _G.Deliver and sellall == true then
  94.                         Deliver()
  95.                     else
  96.                         return
  97.                     end
  98.                 end
  99.             end
  100.         end
  101.     end
  102. end
  103.  
  104. --Put any collect boxes to your rack to the max
  105. function Stack(typeofbox) --Typeof can be a specific box. I might work on that in future
  106.     if _G.Enabled and _G.Stock then
  107.         for i = 1,2 do
  108.             if _G.Enabled and _G.Stock then
  109.                 for i,v in pairs(Warehouse.Racks:GetChildren()) do
  110.                     wait(1)
  111.                     local AAA = string.split(v.Center.RackCapacity.Capacity.Text, "/")
  112.                     if _G.Enabled and _G.Stock and AAA[1] <= AAA[2] then
  113.                         repeat wait()
  114.                             AAA = string.split(v.Center.RackCapacity.Capacity.Text, "/")
  115.                             Box(typeofbox)
  116.                             game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = v.Center.CFrame
  117.                             game:GetService("ReplicatedStorage").Remotes.StackRack:InvokeServer(v)
  118.                         until AAA[1] == AAA[2] or not _G.Stock or not _G.Enabled
  119.                         wait(1)
  120.                     end
  121.                 end
  122.                 game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = Warehouse.Teleport.CFrame
  123.             end
  124.         end
  125.     end
  126. end
  127.  
  128. function GetDelivery()
  129.     for i,v in pairs(game:GetService("Workspace").GameLogic.DeliveryPoints:GetChildren()) do
  130.         if  v:FindFirstChild("SelectionBox").Visible == true then
  131.             return v
  132.         end
  133.     end
  134. end
  135.  
  136. function Deliver()
  137.     if _G.Enabled and _G.Deliver and #game.Players.LocalPlayer.Character.Boxes:GetChildren() > 0 and GetDelivery() and game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame then
  138.         repeat
  139.             wait(0.1)
  140.             local d = GetDelivery()
  141.             if d then
  142.                 game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = d.CFrame
  143.                 game:GetService("ReplicatedStorage").Remotes.SellBox:InvokeServer(d)
  144.             else
  145.                 game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(-387.181885, -0.876028776, 756.432495, 0.759318531, -8.05840443e-08, -0.650719106, 6.34102619e-08, 1, -4.98455499e-08, 0.650719106, -3.41361917e-09, 0.759318531)
  146.             end
  147.         until #game.Players.LocalPlayer.Character.Boxes:GetChildren() < 1 or not _G.Enabled or not _G.Deliver
  148.     else
  149.         repeat wait(0.1)
  150.             game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(-387.181885, -0.876028776, 756.432495, 0.759318531, -8.05840443e-08, -0.650719106, 6.34102619e-08, 1, -4.98455499e-08, 0.650719106, -3.41361917e-09, 0.759318531)
  151.         until GetDelivery()
  152.         Deliver()
  153.     end
  154. end
  155.  
  156. function GetVehicle()
  157.     local a = game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("VehicleMarker")
  158.     local b = a.Adornee
  159.     return b.Parent
  160. end
  161.  
  162. while wait() and _G.Enabled do
  163.     if _G.Deliver then
  164.         PickupBox(true)
  165.     end
  166.     if _G.Stock then
  167.         Stack('all')
  168.     end
  169. end
Add Comment
Please, Sign In to add comment