Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago
Edited 4 years ago
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

0
please stop liking this and read it b4 u like it WideSteal321 773 — 4y
0
I want to know myself too. XxCrazysZz12 20 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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.

Ad

Answer this question