How to reliably stop seats from getting teleported with characters?

My script is currently as follows:

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?

I’ve never heard of this issue, however, you could try checking in the seat if it still has an occupant before teleporting the player.

1 Like

Maybe try this

local jc = player.Character.Humanoid.Jumping:Connect(function()
   player.Character.Humanoid.Landed:Wait()
   player.Character:PivotTo(destination.CFrame)
   jc:Disconnect() -- To save memory
end)

I assume you know where to put this

2 Likes

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)
  

This is what my current code does…

I don’t have much to say other than try the other ways too i guess. Mess around and see if it works lol

Did you try my suggestion about checking the seat occupancy is nil before teleporting?

How can I get the seat from the character?

Have you tried directly destroying the seat weld? Perhaps it takes a frame for the humanoid to destroy the seatweld if done via humanoid.Seated false.

Also could be a client server issue if the client still thinks it has the weld active it might teleport the car alongside.

How can I get the seat weld from the character? I have hundreds of seats so need to find the specific one the client is sitting in…

Parented under the seat.

You can get the seat using humanoid.SeatPart

1 Like
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?

Try changing Humanoid State to anything else rather than Seated or Setting Humanoid State Seated to false

Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,false)

Also does not work (landed seems to fire too early in some cases)

@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)

This works perfectly on my end:

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.

1 Like

The script I sent does not break the seat at all

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.

That’s the most reliable method you would want to go with,
I also think that any other methods would give you the same result.