Advertisement
Elvisfofo_rblx

Teleport gui script

Jun 23rd, 2025
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. -- Services
  2. local Players = game:GetService("Players")
  3. local player = Players.LocalPlayer
  4.  
  5. -- GUI Setup
  6. local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  7. gui.Name = "TeleportGUI"
  8. gui.ResetOnSpawn = false
  9.  
  10. local frame = Instance.new("Frame", gui)
  11. frame.Size = UDim2.new(0, 250, 0, 145)
  12. frame.Position = UDim2.new(0.5, -125, 0.3, 0)
  13. frame.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
  14. frame.BorderSizePixel = 0
  15. frame.Active = true
  16. frame.Draggable = true
  17.  
  18. Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12)
  19.  
  20. -- Variables
  21. local savedPosition = nil
  22. local autoTeleport = false
  23.  
  24. -- Button Creator
  25. local function createButton(text, yPos, color)
  26. local btn = Instance.new("TextButton", frame)
  27. btn.Size = UDim2.new(1, -20, 0, 35)
  28. btn.Position = UDim2.new(0, 10, 0, yPos)
  29. btn.Text = text
  30. btn.Font = Enum.Font.GothamBold
  31. btn.TextSize = 14
  32. btn.TextColor3 = Color3.new(1, 1, 1)
  33. btn.BackgroundColor3 = color
  34. btn.AutoButtonColor = true
  35. Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 10)
  36. return btn
  37. end
  38.  
  39. -- Buttons
  40. local saveBtn = createButton("📌 Save Position", 10, Color3.fromRGB(60, 90, 150))
  41. local tpBtn = createButton("🚀 Teleport", 55, Color3.fromRGB(70, 140, 70))
  42. local autoBtn = createButton("🔁 Auto Teleport: OFF", 100, Color3.fromRGB(140, 80, 80))
  43.  
  44. -- Save Position
  45. saveBtn.MouseButton1Click:Connect(function()
  46. local char = player.Character
  47. if char and char:FindFirstChild("HumanoidRootPart") then
  48. savedPosition = char.HumanoidRootPart.Position
  49. saveBtn.Text = "✅ Position Saved"
  50. end
  51. end)
  52.  
  53. -- Manual Teleport Once
  54. tpBtn.MouseButton1Click:Connect(function()
  55. local char = player.Character
  56. if savedPosition and char and char:FindFirstChild("HumanoidRootPart") then
  57. char.HumanoidRootPart.CFrame = CFrame.new(savedPosition)
  58. end
  59. end)
  60.  
  61. -- Auto Teleport Toggle
  62. autoBtn.MouseButton1Click:Connect(function()
  63. autoTeleport = not autoTeleport
  64. if autoTeleport then
  65. autoBtn.Text = "🔁 Auto Teleport: ON"
  66. autoBtn.BackgroundColor3 = Color3.fromRGB(90, 180, 90)
  67. else
  68. autoBtn.Text = "🔁 Auto Teleport: OFF"
  69. autoBtn.BackgroundColor3 = Color3.fromRGB(140, 80, 80)
  70. end
  71. end)
  72.  
  73. -- Continuous Auto Teleport
  74. task.spawn(function()
  75. while true do
  76. task.wait(0.1)
  77. if autoTeleport and savedPosition then
  78. local char = player.Character
  79. if char and char:FindFirstChild("HumanoidRootPart") then
  80. char.HumanoidRootPart.CFrame = CFrame.new(savedPosition)
  81. end
  82. end
  83. end
  84. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement