How to teleport someone to the position they were x time ago

How could I teleport a person for example where they were 10-30 sec ago

Could I use a while loop for this with a delay of the amount of time

like lag, huh?
maybe try doing this

local character = true -- dont actually do true just do whatever u did to get the character
local counter = 0
local TPCFrame = CFrame.new()
while task.wait(1) do
    if counter < 30 then
        if counter == 0 then
            TPCFrame = character.HumanoidRootPart.CFrame
        end
        counter += 1
    else
        character.HumanoidRootPart.CFrame = TPCFrame
        counter = 0
        TPCFrame = CFrame.new()
    end
end
2 Likes
local Pos

while true do

      Pos = Character.HumanoidRootPart.Position

      wait(10)

end

Can it be like this?

yea but after doing the teleporting i recommend clearing the pos to Pos = Vector3.new()

Put this in ServerScriptService:

wait(5)

for i, Player in pairs(game.Players:GetChildren()) do
	
	while true do
		local OldCFrame = Player.Character.HumanoidRootPart.Position
		wait(15)
		local HRP = Player.Character:FindFirstChild("HumanoidRootPart")
		HRP.Position = OldCFrame + Vector3.new(0,4,0)
	end
end

It worked for me, hope it helps :slightly_smiling_face:

NOTE: Add in a wait(5) before the OldCFrame so it doesn’t repeatedly teleport the player’s to the same position.

1 Like

Why are you adding the Vector3(0, 4, 0)

So the player doesn’t get stuck in the ground.

Trust me, the first time I tested it out, my character kept falling flat on the floor. :sweat_smile:

oof lol…(periods for character limit)

1 Like