repeat task.wait() until game:IsLoaded() local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local PlayerGui = player:WaitForChild("PlayerGui") -- ===== CONFIG ===== local ZONE_POS = Vector3.new(569.09, 284.59, -779.90) local Y_OFFSET = 3 local CHECK_INTERVAL = 0.8 local INTERMISSION_DELAY = 1.2 local POST_JOIN_COOLDOWN = 6 -- ⛔ khóa TP sau khi vào trận -- ================== local lastJoinTime = 0 local function getHRP() local char = player.Character or player.CharacterAdded:Wait() return char:WaitForChild("HumanoidRootPart") end local function distToZone() return (getHRP().Position - ZONE_POS).Magnitude end local function nearZone() return distToZone() < 10 end local function inArena() -- arena luôn ở RẤT XA zone return distToZone() > 80 end local function tpToZone() local hrp = getHRP() hrp.CFrame = CFrame.new(ZONE_POS + Vector3.new(0, Y_OFFSET, 0)) hrp.Anchored = true RunService.Heartbeat:Wait() RunService.Heartbeat:Wait() hrp.Anchored = false end -- check intermission local function isIntermission() for _, v in ipairs(PlayerGui:GetDescendants()) do if v:IsA("TextLabel") then if string.find(string.upper(v.Text), "INTERMISSION") then return true end end end return false end -- phát hiện server vừa TP bạn vào trận local lastPos = nil RunService.Heartbeat:Connect(function() local hrp = getHRP() if lastPos then if (hrp.Position - lastPos).Magnitude > 60 then lastJoinTime = os.clock() end end lastPos = hrp.Position end) -- ===== LOOP CHÍNH ===== task.spawn(function() while true do task.wait(CHECK_INTERVAL) -- 🚫 nếu đang ở arena thì cấm TP if inArena() then continue end -- 🚫 vừa mới vào trận thì cấm TP if os.clock() - lastJoinTime < POST_JOIN_COOLDOWN then continue end -- ✅ chỉ TP khi intermission + không ở zone if isIntermission() and not nearZone() then task.wait(INTERMISSION_DELAY) pcall(tpToZone) end end end)