I have been trying to use PivotTo but it only works the first time and if I try again then it doesn’t work. I’ve already searched the internet but I couldn’t find anything that could help me. Here’s my script:
local debounce = {}
script.Parent.Touched:Connect(function(hit)
if hit:FindFirstAncestor("Vehicle") and not debounce[hit:FindFirstAncestor("Vehicle")] then
local vehicle = hit:FindFirstAncestor("Vehicle")
local seat = vehicle.DriveSeat
debounce[vehicle] = true
--seat.Anchored = true
vehicle:PivotTo(game.Workspace.Baseplate:GetPivot() * CFrame.new(0,50,0))
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.CFrame = CFrame.new(0,0,0)
bodyGyro.Parent = seat
wait(1)
bodyGyro:Destroy()
--seat.Anchored = false
debounce[vehicle] = nil
end
end)
Basically, I’m teleporting the vehicle if it touches something.