Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- -- GUI Setup
- local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
- gui.Name = "TeleportGUI"
- gui.ResetOnSpawn = false
- local frame = Instance.new("Frame", gui)
- frame.Size = UDim2.new(0, 250, 0, 145)
- frame.Position = UDim2.new(0.5, -125, 0.3, 0)
- frame.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12)
- -- Variables
- local savedPosition = nil
- local autoTeleport = false
- -- Button Creator
- local function createButton(text, yPos, color)
- local btn = Instance.new("TextButton", frame)
- btn.Size = UDim2.new(1, -20, 0, 35)
- btn.Position = UDim2.new(0, 10, 0, yPos)
- btn.Text = text
- btn.Font = Enum.Font.GothamBold
- btn.TextSize = 14
- btn.TextColor3 = Color3.new(1, 1, 1)
- btn.BackgroundColor3 = color
- btn.AutoButtonColor = true
- Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 10)
- return btn
- end
- -- Buttons
- local saveBtn = createButton("📌 Save Position", 10, Color3.fromRGB(60, 90, 150))
- local tpBtn = createButton("🚀 Teleport", 55, Color3.fromRGB(70, 140, 70))
- local autoBtn = createButton("🔁 Auto Teleport: OFF", 100, Color3.fromRGB(140, 80, 80))
- -- Save Position
- saveBtn.MouseButton1Click:Connect(function()
- local char = player.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- savedPosition = char.HumanoidRootPart.Position
- saveBtn.Text = "✅ Position Saved"
- end
- end)
- -- Manual Teleport Once
- tpBtn.MouseButton1Click:Connect(function()
- local char = player.Character
- if savedPosition and char and char:FindFirstChild("HumanoidRootPart") then
- char.HumanoidRootPart.CFrame = CFrame.new(savedPosition)
- end
- end)
- -- Auto Teleport Toggle
- autoBtn.MouseButton1Click:Connect(function()
- autoTeleport = not autoTeleport
- if autoTeleport then
- autoBtn.Text = "🔁 Auto Teleport: ON"
- autoBtn.BackgroundColor3 = Color3.fromRGB(90, 180, 90)
- else
- autoBtn.Text = "🔁 Auto Teleport: OFF"
- autoBtn.BackgroundColor3 = Color3.fromRGB(140, 80, 80)
- end
- end)
- -- Continuous Auto Teleport
- task.spawn(function()
- while true do
- task.wait(0.1)
- if autoTeleport and savedPosition then
- local char = player.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- char.HumanoidRootPart.CFrame = CFrame.new(savedPosition)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement