Add in a more aesthetic GUI and make it loop teleport on press the start button, and also add in cframe as well as ALWAYS facing the direction they're facing when teleporting.

```
-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local ScreenGui = Instance.new("ScreenGui")
local TextBox = Instance.new("TextBox")
local TeleportButton = Instance.new("TextButton")

-- Configuration
local DOUBLE_PRESS_INTERVAL = 0.5       -- Time in seconds to detect double press
local TELEPORT_DISTANCE = 2              -- Distance behind the target
local TELEPORT_COOLDOWN = 0.1            -- Cooldown time in seconds after teleporting

-- Variables
local player = Players.LocalPlayer
local lastPressTime = 0
local pressCount = 0
local isCooldown = false

-- Heartbeat Connection for Cooldown
local heartbeatConnection

-- Function to Notify Player
local function notifyPlayer(title, text, duration)
    game.StarterGui:SetCore("SendNotification", {
        Title = title,
        Text = text,
        Duration = duration or 2,
    })
end

-- Function to Find Target by Username
local function findTargetByUsername(username)
    for _, otherPlayer in ipairs(Players:GetPlayers()) do
        if otherPlayer.Name:lower() == username:lower() then
            return otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart")
        end
    end
    return nil
end

-- Function to Teleport Behind Target with Correct Facing
local function teleportBehind(targetCFrame, targetName)
    if not targetCFrame then return end

    -- Calculate Behind Position
    local behindOffset = targetCFrame.LookVector * -TELEPORT_DISTANCE
    local teleportPosition = targetCFrame.Position + behindOffset

    -- Create New CFrame Facing Away from Target's Front
    local newCFrame = CFrame.new(teleportPosition) * CFrame.Angles(0, math.pi, 0)

    -- Teleport the Player
    local character = player.Character
    local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
    if humanoidRootPart then
        humanoidRootPart.CFrame = newCFrame
        -- Notify Player of Successful Teleport
        notifyPlayer("Teleportation", "You have been teleported behind " .. targetName .. "!", 2)
    end
end

-- Function to Handle Teleportation
local function handleTeleport(username)
    local target = findTargetByUsername(username)
    if target then
        local targetName = target.Parent and target.Parent.Name or "Target"
        teleportBehind(target.CFrame, targetName)
    else
        -- Notify Player of No Available Target
        notifyPlayer("Teleportation Failed", "No valid target found to teleport behind.", 2)
    end
end

-- Function to Start Cooldown Using Heartbeat
local function startCooldown()
    isCooldown = true
    local elapsed = 0

    heartbeatConnection = RunService.Heartbeat:Connect(function(deltaTime)
        elapsed = elapsed + deltaTime
        if elapsed >= TELEPORT_COOLDOWN then
            isCooldown = false
            if heartbeatConnection then
                heartbeatConnection:Disconnect()
                heartbeatConnection = nil
            end
        end
    end)
end

-- Function to Handle Button Click
local function onTeleportButtonClick()
    if isCooldown then return end
    local username = TextBox.Text
    handleTeleport(username)
    startCooldown()
end

-- Setup GUI
ScreenGui.Parent = player:WaitForChild("PlayerGui")

TextBox.Parent = ScreenGui
TextBox.Size = UDim2.new(0, 200, 0, 50) -- Size of the TextBox
TextBox.Position = UDim2.new(0.5, -100, 0, 50) -- Centered on the screen
TextBox.PlaceholderText = "Enter Username"
TextBox.TextColor3 = Color3.new(1, 1, 1) -- White text
TextBox.BackgroundColor3 = Color3.new(0, 0, 0) -- Black background

TeleportButton.Parent = ScreenGui
TeleportButton.Size = UDim2.new(0, 200, 0, 50) -- Size of the Button
TeleportButton.Position = UDim2.new(0.5, -100, 0, 110) -- Below the TextBox
TeleportButton.Text = "Teleport"
TeleportButton.BackgroundColor3 = Color3.new(0, 0.5, 0) -- Green background
TeleportButton.TextColor3 = Color3.new(1 , 1, 1) -- White text

-- Connect Button Click Listener
TeleportButton.MouseButton1Click:Connect(onTeleportButtonClick)

-- Reset Cooldown on Character Respawn
player.CharacterAdded:Connect(function(char)
    isCooldown = false
    if heartbeatConnection then
        heartbeatConnection:Disconnect()
        heartbeatConnection = nil
    end
end)