So I’ve made 100 different versions of this script and it just glitches out each time, sometimes it works sometimes it doesnt. Most of the time it works in studio most of the time it breaks in game.
it’s supposed to teleport the car to the other lane, turn it around and keep the velocity.
local TP1 = script.Parent.TeleportStart
local pos = CFrame.new(Vector3.new(script.Parent.WantedPos.Position)) * CFrame.Angles(0, math.rad(180), 0)
local debounce = true
TP1.Touched:Connect(function(hit)
if debounce == true and hit.Name == "DriveSeat" then
debounce = false
local Porsche = hit.Parent
Porsche.PrimaryPart = hit
Porsche:PivotTo(pos)
for i, v in pairs(Porsche:GetDescendants()) do
if v.Name == "DriveSeat" or v:IsA("BasePart") or v:IsA("MeshPart") then
v.Velocity = v.Velocity * Vector3.new(-1, 1, -1)
end
end
wait(5)
debounce = true
end
end)