while player.Character.Humanoid.Sit do
player.Character:WaitForChild("Humanoid").Jump = true
task.wait(0.1)
end
player.Character:PivotTo(destination.CFrame)
Despite this, I receive routine bug reports of seat parts that have been moved with the character while they teleport.
Is there something else I can do in my script to reliably stop that from happening?
local jc = player.Character.Humanoid.Jumping:Connect(function()
player.Character.Humanoid.Landed:Wait()
player.Character:PivotTo(destination.CFrame)
jc:Disconnect() -- To save memory
end)
You could try un-sitting the player right before they get teleported:
-- not sure if any of the code below will realy work, but you might get some useful ideas
function tpPlayer()
player.Character.Humanoid.HumanoidStateType = Enum.HumanoidStateType.Jumping -- you could try this
player.Character.Humanoid.Seated = false -- or this
wait()
player.Character:PivotTo(destination)
end
event:Connect(tpPlayer)
if player.Character.Humanoid.SeatPart then
player.Character.Humanoid.SeatPart.SeatWeld:Destroy()
task.wait(0.1)
end
player.Character:PivotTo(game.Workspace.TeleportPoints:FindFirstChild(destination).CFrame)
Has not reliably fixed the problem… anything I should change?
@dthecoolest’s advice is quite reasonable, but if it doesn’t work then ig we have to keep trying solutions
repeat wait() until player.Character.Humanoid.SeatPart.Occupant == nil
task.wait(.1) -- Just a precaution
player.Character:PivotTo(game.Workspace.TeleportPoints:FindFirstChild(destination).CFrame)
while task.wait() do
if player.Character:WaitForChild("Humanoid").Sit then
player.Character:WaitForChild("Humanoid").Sit = false
end
end
player.Character.HumanoidRootPart.CFrame = destination.CFrame
This is what should work, and does work in 99.9% of cases… the problem is in the 0.01%, it permanently breaks the seat. I don’t really know for sure what is causing this to happen (possibly server lag?), but even if it’s rare, when a server has been up for 5-6 days, it ends up with fully half of the seats teleported to weird locations.
The script you sent was my original method for handling this. I’m sure it works in testing, but on a live server with lag, and over thousands of teleports, it does not work reliably.