Advertisement
gluxiisbad123

sdadssddasdsa

Aug 5th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local Remotes = ReplicatedStorage.Remotes
  3. local LoadVehicle = Remotes.LoadVehicle
  4. local pickupBox = Remotes.PickupBox
  5. local StackRack = Remotes.StackRack
  6. local SellBox = Remotes.SellBox
  7. local Players = game:GetService("Players")
  8. local LocalPlayer = Players.LocalPlayer
  9. local Warehouses = workspace.GameLogic.Warehouses
  10. local boxes = workspace.GameLogic.SpawnedBoxes
  11.  
  12. function GetWearhouse()
  13. for Index, Value in next, Warehouses:GetChildren() do
  14. if Value.Owner.Value == LocalPlayer then
  15. return Value
  16. end
  17. end
  18. for Index, Value in next, Warehouses:GetChildren() do
  19. if Value.Owner.Value == nil then
  20. LocalPlayer.Character.HumanoidRootPart.CFrame = Value.ClaimPoint.CFrame
  21. wait(1)
  22. return Value
  23. end
  24. end
  25.  
  26. end
  27.  
  28. local Warehouse = GetWearhouse()
  29.  
  30. local function GetBoxes()
  31. local target
  32. repeat
  33. target = boxes:FindFirstChild("Ultimate Box") and boxes['Ultimate Box'] or
  34. boxes:FindFirstChild("Galaxy Box") and boxes['Galaxy Box'] or
  35. boxes:FindFirstChild("Fire Box") and boxes['Fire Box'] or
  36. boxes:FindFirstChild("Godly Box") and boxes['Godly Box'] or
  37. boxes:FindFirstChild("Rainbow Box") and boxes['Rainbow Box'] or
  38. boxes:FindFirstChild("Obsidian Box") and boxes['Obsidian Box'] or
  39. boxes:FindFirstChild("Diamond Box") and boxes['Diamond Box'] or
  40. boxes:FindFirstChild("Emerald Box") and boxes['Emerald Box'] or
  41. boxes:FindFirstChild("Golden Box") and boxes['Golden Box'] or
  42. boxes:FindFirstChild("Silver Box") and boxes['Silver Box'] or
  43. boxes:FindFirstChild("Big Box") and boxes['Big Box'] or
  44. boxes:FindFirstChild("Long Box") and boxes['Long Box'] or
  45. boxes:FindFirstChild("Small Box") and boxes['Small Box']
  46. wait()
  47. until target
  48. warn(target)
  49. LocalPlayer.Character.HumanoidRootPart.CFrame = target.PrimaryPart.CFrame
  50. wait(.1)
  51. pickupBox:InvokeServer(target)
  52. wait(.1)
  53.  
  54. StoreBoxes()
  55. end
  56.  
  57.  
  58. function StoreBoxes()
  59. for Index, Value in next, Warehouse.Racks:GetChildren() do
  60. LocalPlayer.Character.HumanoidRootPart.CFrame = Value.Center.CFrame + Vector3.new(0,5,0)
  61. wait(.1)
  62. StackRack:InvokeServer(Value)
  63. end
  64. Sell()
  65. end
  66.  
  67. function GetDeliveryPoint()
  68. LocalPlayer.Character.PrimaryPart.CFrame = CFrame.new(-96.842796325684, 3.4265742301941, 381.41323852539)
  69. wait(.2)
  70. for Index, Value in next, workspace.GameLogic.DeliveryPoints:GetChildren() do
  71. if Value:FindFirstChild("BoxesToDeliver") then
  72. return Value
  73. end
  74. end
  75. end
  76.  
  77. function Sell()
  78. for Index, Value in next, Warehouse.Racks:GetChildren() do
  79. for Index2, Value2 in next, Value.Boxes:GetChildren() do
  80. pickupBox:InvokeServer(Value2)
  81. wait(.1)
  82. local point
  83. repeat
  84. point = GetDeliveryPoint()
  85. until point
  86. LocalPlayer.Character.HumanoidRootPart.CFrame = point.CFrame
  87. wait(.1)
  88. repeat
  89. SellBox:InvokeServer(point)
  90. wait(.25)
  91. until #LocalPlayer.Character.Boxes:GetChildren() == 0
  92. end
  93. end
  94. GetBoxes()
  95. end
  96.  
  97. GetBoxes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement