local CloneVehicle = hit.Parent
local ClonedVehicle = CloneVehicle:Clone()
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "RedRectangleVehicle" then
ClonedVehicle.Position = Vector3.new(-1093.61, 0.5, -5.75)
ClonedVehicle.Parent = workspace
end
end)
How to clone a touched part? What have I mistaken in my code? I used PrimaryPart script to move my vehicle.

10 comments
Have you tried ClonedVehicle.CFrame = CFrame.new(-1093.61, 0.5, -5.75)
You mean teleporting the vehicle? I was thinking about that. Ill try later.
Also, your CloneVehicle would be nil as as you have not set it to the parts name. You need to set the name like something “CloneVehicle = YOURTEXTHERE”
Ok
I don't understand. Also what is nil? I have no idea what is that.
Ok nil is zero
I thought: game.Workspace.RedRectangleVehicle:MoveTo(Vector3.new(-1098.925, 0.5, -5.34) will fix the problem. But It does nothing.
script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then script.Parent:Clone() end end) Ths will dupe the part that is touched if touched by player
Your problem is actually that you're cloning the object in the beginning, you need to set the ClonedVehicled variable inside the function, so you clone it each time
you should try using :Clone() bc thats how you clone stuff. for example if i want to clone a block i would use part touched function then make it detect for humanoid then if there is one workspace.NAME:Clone(). NAME.Parent.Head.Position (IF U WANT IT ON AN NPC)