So, I’m once again having issues learning simple scripting. And I feel that getting help from Forums would be better than not being able to overcome future issues on projects. So, I’m working on a simple code that should teleport cars to a certain position using X Y and Z coordinates. I’ve got a code written already, but it doesn’t seem to work once the vehicle I’m seated in collides with the part this script it in. I’m not sure if it has to do with the player being inside the vehicle either, that could cause complications as well because, I’m not entirely sure. Any tips or solutions?
function onTouch(hit)
if hit.Name == "Car" then
hit.Car:PivotTo(currentPivot * CFrame.new(0, 90, -10))
end
end
script.Parent.Touched:connect(onTouch)