Our Discord Channel Our Telegram

Script Description

A script that allows you to teleport to any player on the map. In the first line, replace TARGETS_USERNAME with the username of the player you want to teleport to.

Script Functions

1 functions

Show functions Hide functions
  • teleport to any player

Script Code

36 lines · 1 KB · Lua

Review the code before running it. Use scripts responsibly and only with tools you trust.

local target = "TARGETS_USERNAME" -- targets username
local behindOffset = 10 -- how far behind the target you want to teleport

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local stableTime = 0
local lastTeleportPos = nil

while true do
    local targetPlayer = Players:FindFirstChild(target)
    if not targetPlayer or not player.Character or not targetPlayer.Character then break end

    local myRoot = player.Character.HumanoidRootPart
    local targetRoot = targetPlayer.Character.HumanoidRootPart
    if not myRoot or not targetRoot then break end

    if lastTeleportPos then
        local myRootPos = myRoot.Position
        local teleportCheck = math.abs(myRootPos.X - lastTeleportPos.X) >= 100 or math.abs(myRootPos.Y - lastTeleportPos.Y) >= 100 or math.abs(myRootPos.Z - lastTeleportPos.Z) >= 100

        if teleportCheck then
            stableTime = 0
        else
            stableTime = stableTime + 0.09
            if stableTime >= 1.0 then
                break
            end
        end
    end

    myRoot.CFrame = targetRoot.CFrame * CFrame.new(0, 0, behindOffset)
    lastTeleportPos = myRoot.Position
    task.wait(0.09)
end

Comments

0

No comments yet.