Thank you for using our website
Your script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
local Smuggler = workspace.Miscellaneous.Vendors.Smuggler
local LargeCrateofGoods = ReplicatedStorage.SmugglePackages["Large Crate of Goods"]
local BuySmugglingPackage = ReplicatedStorage:WaitForChild("BuySmugglingPackage") -- RemoteEvent
local GetPackageDropOffPosition = ReplicatedStorage:WaitForChild("GetPackageDropOffPosition") -- RemoteFunction
-- Loop 1: continuously buy packages every 1 second
task.spawn(function()
while true do
BuySmugglingPackage:FireServer(Smuggler, LargeCrateofGoods)
task.wait(0.5)
end
end)
-- Loop 2: continuously teleport to dropoff points
task.spawn(function()
while true do
local dropOffPositions = GetPackageDropOffPosition:InvokeServer()
if typeof(dropOffPositions) == "table" then
for _, pos in ipairs(dropOffPositions) do
if typeof(pos) == "Vector3" then
rootPart.CFrame = CFrame.new(pos + Vector3.new(0,3,0))
task.wait(0.3)
end
end
elseif typeof(dropOffPositions) == "Vector3" then
rootPart.CFrame = CFrame.new(dropOffPositions + Vector3.new(0,3,0))
task.wait(0.3)
end
task.wait(0.5) -- small wait before checking dropoff points again
end
end)