Make an object spawn at a place

Hey there, I am working on a car spawner, but the one I currently have makes it so the car in Server Storage is right at the point where I want it. Therefore if I have multiple spawners, they all have to have cars with different names. This is the script:

script.Parent.MouseButton1Click:Connect(function(GetCar)
local Mod = game.ServerStorage.Cars.Camaro -- name of the car
local clone = Mod:Clone()
	clone.Parent = workspace
	clone:MakeJoints()
end)

That script is in a button which is on a GUI which opens when you click on a part. I would like to know if I could make it so the part would spawn a certain amount of studs away from the original part. I’ve tried doing research on the forum and online, but I can’t seem to find any results. Can anyone help?

2 Likes
local Amount = 0 -- amount of cars that are spawned
car:SetPrimaryPartCFrame(
    car.PrimaryPart.CFrame * CFrame.new(Amount * 10, 0, 0)
) -- sloppy way of doing it i guess

so would this go right after the MakeJoints thing? And not totally sure what the local amount is. If you haven’t noticed, I’m not a very good scripter lol

Amount is a variable for the current amount of cars that are spawned.
I’m guessing you know what the PrimaryPart is, so you can set the CFrame of that to an offset based on how many cars there are (Amount). Multiply it by 10 so each car is 10 studs away from each other.