Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Remotes = ReplicatedStorage.Remotes
- local LoadVehicle = Remotes.LoadVehicle
- local pickupBox = Remotes.PickupBox
- local StackRack = Remotes.StackRack
- local SellBox = Remotes.SellBox
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Warehouses = workspace.GameLogic.Warehouses
- local boxes = workspace.GameLogic.SpawnedBoxes
- function GetWearhouse()
- for Index, Value in next, Warehouses:GetChildren() do
- if Value.Owner.Value == LocalPlayer then
- return Value
- end
- end
- for Index, Value in next, Warehouses:GetChildren() do
- if Value.Owner.Value == nil then
- LocalPlayer.Character.HumanoidRootPart.CFrame = Value.ClaimPoint.CFrame
- wait(1)
- return Value
- end
- end
- end
- local Warehouse = GetWearhouse()
- local function GetBoxes()
- local target
- repeat
- target = boxes:FindFirstChild("Ultimate Box") and boxes['Ultimate Box'] or
- boxes:FindFirstChild("Galaxy Box") and boxes['Galaxy Box'] or
- boxes:FindFirstChild("Fire Box") and boxes['Fire Box'] or
- boxes:FindFirstChild("Godly Box") and boxes['Godly Box'] or
- boxes:FindFirstChild("Rainbow Box") and boxes['Rainbow Box'] or
- boxes:FindFirstChild("Obsidian Box") and boxes['Obsidian Box'] or
- boxes:FindFirstChild("Diamond Box") and boxes['Diamond Box'] or
- boxes:FindFirstChild("Emerald Box") and boxes['Emerald Box'] or
- boxes:FindFirstChild("Golden Box") and boxes['Golden Box'] or
- boxes:FindFirstChild("Silver Box") and boxes['Silver Box'] or
- boxes:FindFirstChild("Big Box") and boxes['Big Box'] or
- boxes:FindFirstChild("Long Box") and boxes['Long Box'] or
- boxes:FindFirstChild("Small Box") and boxes['Small Box']
- wait()
- until target
- warn(target)
- LocalPlayer.Character.HumanoidRootPart.CFrame = target.PrimaryPart.CFrame
- wait(.1)
- pickupBox:InvokeServer(target)
- wait(.1)
- StoreBoxes()
- end
- function StoreBoxes()
- for Index, Value in next, Warehouse.Racks:GetChildren() do
- LocalPlayer.Character.HumanoidRootPart.CFrame = Value.Center.CFrame + Vector3.new(0,5,0)
- wait(.1)
- StackRack:InvokeServer(Value)
- end
- Sell()
- end
- function GetDeliveryPoint()
- LocalPlayer.Character.PrimaryPart.CFrame = CFrame.new(-96.842796325684, 3.4265742301941, 381.41323852539)
- wait(.2)
- for Index, Value in next, workspace.GameLogic.DeliveryPoints:GetChildren() do
- if Value:FindFirstChild("BoxesToDeliver") then
- return Value
- end
- end
- end
- function Sell()
- for Index, Value in next, Warehouse.Racks:GetChildren() do
- for Index2, Value2 in next, Value.Boxes:GetChildren() do
- pickupBox:InvokeServer(Value2)
- wait(.1)
- local point
- repeat
- point = GetDeliveryPoint()
- until point
- LocalPlayer.Character.HumanoidRootPart.CFrame = point.CFrame
- wait(.1)
- repeat
- SellBox:InvokeServer(point)
- wait(.25)
- until #LocalPlayer.Character.Boxes:GetChildren() == 0
- end
- end
- GetBoxes()
- end
- GetBoxes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement