Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a reliable way to teleport someone who's on a seat?

function teleAllPlayers()
	for _,v in pairs(game.Players:GetChildren())do
		if v.Settings.AutoTele.Value then
			v.Character.Humanoid.Sit= false
v.Character.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("Tele").CFrame

		end
	end
end

these don't seem to destroy the weld fast enough so the seat and whatever unanchored parts welded to the seat get teleported too

v.Character.Humanoid.Sit = false
v.Character.Humanoid.Jump = true

If I did this

v.Character.Humanoid.Sit= false
wait(.1)
v.Character.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("Tele").CFrame

This is unreliable because .1sec may or may not give the weld enough time to be removed, but also during this time the player might resit onto the seat

using

repeat wait() until v.Character.Humanoid.Sit == false

seems to be working for me right now, but sources ive read says its not 100% reliable

2 comments

0

please stop liking this and read it b4 u like it

0

I want to know myself too.

1 answer

Hmm. You could try humanoid:Jump().

function teleAllPlayers()
    for _,v in pairs(game.Players:GetChildren())do
        if v.Settings.AutoTele.Value then
            v.Character.Humanoid.Jump = true
wait(.05)
v.Character.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("Tele").CFrame

        end
    end
end

It gives you more time to teleport the player while the character is in the air.

This discussion is preserved as it was. New answers, comments, and votes are closed.