teleportation script
Key RequiredUniversal

teleportation script

Universal ScriptYolkaCoderRBYolkaCoderRB 91 views 1.4K executesUpdated Aug 21, 2026
Unrated
00
Lua Script•293 lines (9366 chars)
--[[
    Teleport Saver v7 (Final)
    - No minimize button
    - Working close button (X)
    - Instant teleport
    - All buttons rounded
    - Black color scheme
]]

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local CoreGui = game:GetService("CoreGui")
local player = Players.LocalPlayer

local savedPos = nil
local isDragging = false
local dragStart = nil
local startPos = nil

-- Instant teleport
local function teleportInstant(character, targetPos)
    local hrp = character and character:FindFirstChild("HumanoidRootPart")
    if not hrp then return false end
    hrp.CFrame = CFrame.new(targetPos)
    return true
end

-- GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "TeleportSaver"
screenGui.Parent = CoreGui

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 220, 0, 170)
frame.Position = UDim2.new(0.5, -110, 0.5, -85)
frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)          -- pure black
frame.BackgroundTransparency = 0.15
frame.BorderSizePixel = 0
frame.ClipsDescendants = true
frame.Parent = screenGui

local frameCorner = Instance.new("UICorner")
frameCorner.CornerRadius = UDim.new(0, 14)
frameCorner.Parent = frame

-- Title bar
local titleFrame = Instance.new("Frame")
titleFrame.Size = UDim2.new(1, -10, 0, 35)
titleFrame.Position = UDim2.new(0, 5, 0, 5)
titleFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)  -- dark gray
titleFrame.BackgroundTransparency = 0.3
titleFrame.BorderSizePixel = 0
titleFrame.Parent = frame

local titleCorner = Instance.new("UICorner")
titleCorner.CornerRadius = UDim.new(0, 10)
titleCorner.Parent = titleFrame

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, -40, 0, 35)
title.Position = UDim2.new(0, 5, 0, 0)
title.Text = "📍 Teleport"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.BackgroundTransparency = 1
title.Font = Enum.Font.GothamBold
title.TextSize = 17
title.Active = true
title.Selectable = true
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = titleFrame

-- Close button (X)
local closeBtn = Instance.new("TextButton")
closeBtn.Size = UDim2.new(0, 32, 0, 32)
closeBtn.Position = UDim2.new(1, -36, 0, 1)
closeBtn.Text = "X"
closeBtn.BackgroundColor3 = Color3.fromRGB(150, 30, 30)   -- dark red
closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
closeBtn.BorderSizePixel = 0
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextSize = 18
closeBtn.Parent = titleFrame

local closeCorner = Instance.new("UICorner")
closeCorner.CornerRadius = UDim.new(0, 8)
closeCorner.Parent = closeBtn

-- Content container
local contentContainer = Instance.new("Frame")
contentContainer.Size = UDim2.new(1, 0, 1, -50)
contentContainer.Position = UDim2.new(0, 0, 0, 45)
contentContainer.BackgroundTransparency = 1
contentContainer.Parent = frame

local layout = Instance.new("UIListLayout")
layout.FillDirection = Enum.FillDirection.Vertical
layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
layout.VerticalAlignment = Enum.VerticalAlignment.Top
layout.Padding = UDim.new(0, 10)
layout.Parent = contentContainer

-- Save button
local saveBtn = Instance.new("TextButton")
saveBtn.Size = UDim2.new(0, 170, 0, 38)
saveBtn.Text = "💾 Save Position"
saveBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)     -- dark gray
saveBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
saveBtn.BorderSizePixel = 0
saveBtn.Font = Enum.Font.GothamBold
saveBtn.TextSize = 15
saveBtn.Parent = contentContainer

local saveCorner = Instance.new("UICorner")
saveCorner.CornerRadius = UDim.new(0, 10)
saveCorner.Parent = saveBtn

-- Load button
local loadBtn = Instance.new("TextButton")
loadBtn.Size = UDim2.new(0, 170, 0, 38)
loadBtn.Text = "📂 Load Position"
loadBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)     -- dark gray
loadBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
loadBtn.BorderSizePixel = 0
loadBtn.Font = Enum.Font.GothamBold
loadBtn.TextSize = 15
loadBtn.Parent = contentContainer

local loadCorner = Instance.new("UICorner")
loadCorner.CornerRadius = UDim.new(0, 10)
loadCorner.Parent = loadBtn

-- Info label
local infoLabel = Instance.new("TextLabel")
infoLabel.Size = UDim2.new(1, -20, 0, 30)
infoLabel.Text = "Position not saved"
infoLabel.TextColor3 = Color3.fromRGB(180, 180, 180)
infoLabel.BackgroundTransparency = 1
infoLabel.Font = Enum.Font.Gotham
infoLabel.TextSize = 13
infoLabel.TextXAlignment = Enum.TextXAlignment.Center
infoLabel.Parent = contentContainer

-- Notification
local notification = Instance.new("TextLabel")
notification.Size = UDim2.new(1, -20, 0, 30)
notification.Text = ""
notification.TextColor3 = Color3.fromRGB(255, 255, 255)
notification.BackgroundColor3 = Color3.fromRGB(0, 0, 0, 0.5)
notification.BackgroundTransparency = 1
notification.Font = Enum.Font.Gotham
notification.TextSize = 13
notification.TextXAlignment = Enum.TextXAlignment.Center
notification.Visible = false
notification.Parent = contentContainer

-- Functions
local function updateInfo()
    if savedPos then
        infoLabel.Text = string.format("Saved: (%.1f, %.1f, %.1f)", savedPos.X, savedPos.Y, savedPos.Z)
    else
        infoLabel.Text = "Position not saved"
    end
end

local function showNotification(text, color)
    color = color or Color3.fromRGB(0, 255, 0)
    notification.Text = text
    notification.BackgroundColor3 = color
    notification.BackgroundTransparency = 0.7
    notification.Visible = true
    task.wait(1.5)
    notification.Visible = false
end

-- Handlers
local function onSave()
    local character = player.Character
    if not character then
        showNotification("❌ Character not found!", Color3.fromRGB(255, 100, 100))
        return
    end
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if not hrp then
        showNotification("❌ HumanoidRootPart not found!", Color3.fromRGB(255, 100, 100))
        return
    end
    savedPos = hrp.Position
    updateInfo()
    showNotification("✅ Saved!", Color3.fromRGB(0, 255, 0))
    saveBtn.BackgroundColor3 = Color3.fromRGB(100, 200, 100)
    task.wait(0.2)
    saveBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
end

local function onLoad()
    if not savedPos then
        showNotification("⚠️ Save position first!", Color3.fromRGB(255, 200, 0))
        return
    end
    local character = player.Character
    if not character then
        showNotification("❌ Character not found!", Color3.fromRGB(255, 100, 100))
        return
    end
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if not hrp then
        showNotification("❌ HumanoidRootPart not found!", Color3.fromRGB(255, 100, 100))
        return
    end
    
    loadBtn.BackgroundColor3 = Color3.fromRGB(100, 200, 255)
    task.wait(0.2)
    loadBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
    
    if teleportInstant(character, savedPos) then
        showNotification("✅ Teleported!", Color3.fromRGB(100, 200, 255))
        infoLabel.Text = string.format("Teleported to (%.1f, %.1f, %.1f)", savedPos.X, savedPos.Y, savedPos.Z)
    else
        showNotification("❌ Teleport error!", Color3.fromRGB(255, 100, 100))
    end
end

-- Connect events
saveBtn.MouseButton1Click:Connect(onSave)
saveBtn.TouchTap:Connect(onSave)

loadBtn.MouseButton1Click:Connect(onLoad)
loadBtn.TouchTap:Connect(onLoad)

closeBtn.MouseButton1Click:Connect(function()
    screenGui:Destroy()
end)
closeBtn.TouchTap:Connect(function()
    screenGui:Destroy()
end)

-- Dragging
local function startDrag(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        isDragging = true
        dragStart = input.Position
        startPos = frame.Position
    end
end

local function updateDrag(input)
    if not isDragging then return end
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        local delta = input.Position - dragStart
        frame.Position = UDim2.new(
            startPos.X.Scale,
            startPos.X.Offset + delta.X,
            startPos.Y.Scale,
            startPos.Y.Offset + delta.Y
        )
    end
end

local function endDrag(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        isDragging = false
    end
end

title.InputBegan:Connect(startDrag)
title.InputChanged:Connect(updateDrag)
title.InputEnded:Connect(endDrag)

UserInputService.InputChanged:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if isDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
        local delta = input.Position - dragStart
        frame.Position = UDim2.new(
            startPos.X.Scale,
            startPos.X.Offset + delta.X,
            startPos.Y.Scale,
            startPos.Y.Offset + delta.Y
        )
    end
end)

UserInputService.InputEnded:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        isDragging = false
    end
end)

-- Initialization
frame.Size = UDim2.new(0, 220, 0, 170)
frame.BackgroundTransparency = 0.15
updateInfo()
print("[Teleport Saver] Loaded. All buttons are rounded, dark theme.")

Features & Information

Minimalistic script for teleportation.
#Free#Keyless

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts