I am confused. I am wondering how do I make this model MoveTo() around the player. The road is 73 studs wide. I tried to make it move to the HumanoidRootPart, but it just moves the car to the center.
local random = Random.new()
local Cars = {5083437873, 5083676767}
while wait(1) do
wait(0.1) --Frick
whichNum = random:NextInteger(1, #Cars)
print(("Picked: " .. whichNum))
local root = game:GetService("InsertService"):LoadAsset(Cars[whichNum])
local instances = root:GetChildren()
if #instances == 0 then
root:Destroy()
return
end
root = root:GetChildren()
if #root == 1 then
root = root[1]
else return end
print(root)
root.Body.Drive.Disabled = false
root.Parent = workspace
game.Players.PlayerAdded:connect(function(player)
root:MoveTo(player.HumanoidRootPart.Position+Vector3.new(math.random(1,73),0,0))
end)
end

9 comments
The cars are now spawning in the middle of the highway, not where the character is. ALSO I NEED THE LOOP SO IT CAN SPAWN MORE CARS.
Also the cars delete themselves after an amount of time.
just updated my answer
also, if
rootis a model, then useroot:SetPrimaryPartCFrameto position the carHow do I use SetPrimaryPartCFrame?
Nvm about that. The cars are just exploding and you get flung into space. I need help.
Position the car a few studs away from the player's character..
But how?
character:GetPrimaryPartCFrame() - CFrame.new(offsetX, 0, offsetZ);