Anti position teleport
Key RequiredUniversal

Anti position teleport

Universal ScriptAedan_Aedan_ 3.7K views 36 executesUpdated Jan 9, 2025
Unrated
00
Lua Script•34 lines (1250 chars)
local lastPosition = nil -- Track the player's last valid position
local safeZoneRadius = 5 -- Radius of safe zone in studs
local teleportResetTime = 0.5 -- Time in seconds to reset teleport count
if safeZoneRadius<5 then
    safeZoneRadius=5
end -- Minimum safe zone radius
local function teleportBack()
    local chr = game.Players.LocalPlayer.Character
    if chr and lastPosition then
        local humanoidRootPart = chr:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            humanoidRootPart.CFrame = CFrame.new(lastPosition)
        end
    end
end
game:GetService("RunService").Heartbeat:Connect(function()
    local chr = game.Players.LocalPlayer.Character
    if chr then
        local humanoidRootPart = chr:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            local currentPosition = humanoidRootPart.Position
            if not lastPosition then
                lastPosition = currentPosition
                return
            end
            local distance = (currentPosition - lastPosition).Magnitude
            if distance > safeZoneRadius then
                teleportBack()
            else
                lastPosition = currentPosition
            end
        end
    end
end)

Features & Information

Doesn’t allow teleportation outside of a safe zone Buggy

Community Comments (1)

Aedan_Aedan_Jan 9, 2025(edited)

Sorry while publishing I didn’t have time to do image :(

More Scripts for Universal Scripts