RXYSETTINGS

Auto TP

Dec 22nd, 2025 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.13 KB | Source Code | 0 0
  1. --// AUTO TELEPORT CP ROUTE UI (Dark Theme)
  2. --// By Kitoo for ILHAM (Full Version)
  3. local Players = game:GetService("Players")
  4. local RunService = game:GetService("RunService")
  5. local TweenService = game:GetService("TweenService")
  6. local TeleportService = game:GetService("TeleportService")
  7. local HttpService = game:GetService("HttpService")
  8. local UIS = game:GetService("UserInputService")
  9. local lp = Players.LocalPlayer
  10. local char = lp.Character or lp.CharacterAdded:Wait()
  11. local hrp = char:WaitForChild("HumanoidRootPart")
  12. lp.CharacterAdded:Connect(function(c)
  13.     char = c
  14.     hrp = char:WaitForChild("HumanoidRootPart")
  15. end)
  16. local LocalPlayer = Players.LocalPlayer
  17. local PlaceId = game.PlaceId
  18. local PRESET_FOLDER = ".Cordinat"
  19. local CurrentPreset = nil
  20. local MAX_HOP_TRIES = 5
  21. local hopTries = 0
  22. local teleporting = false
  23. local VisitedServers = {}
  24. local function getPresetFiles()
  25.     local files = {}
  26.     if listfiles and isfolder and isfolder(PRESET_FOLDER) then
  27.         for _,f in ipairs(listfiles(PRESET_FOLDER)) do
  28.             if f:sub(-5) == ".json" then
  29.                 table.insert(files, f:match("[^/]+$"))
  30.             end
  31.         end
  32.     end
  33.     table.sort(files)
  34.     return files
  35. end
  36.  
  37. local function loadPreset(fileName)
  38.     local path = PRESET_FOLDER.."/"..fileName
  39.     if not isfile(path) then return end
  40.  
  41.     local ok, raw = pcall(function()
  42.         return HttpService:JSONDecode(readfile(path))
  43.     end)
  44.     if not ok or type(raw) ~= "table" then return end
  45.     local ordered, data = {}, {}
  46.  
  47.     for id,vec in pairs(raw) do
  48.         data[id] = Vector3.new(vec[1], vec[2], vec[3])
  49.         if id ~= "smt" then
  50.             table.insert(ordered, id)
  51.         end
  52.     end
  53.  
  54.     table.sort(ordered, function(a,b)
  55.         return tonumber(a) < tonumber(b)
  56.     end)
  57.  
  58.     if raw["smt"] then
  59.         table.insert(ordered, "smt")
  60.     end
  61.  
  62.     return ordered, data
  63. end
  64. --========================================================--
  65. -- DATA CHECKPOINT
  66. --========================================================--
  67.  
  68. local CheckpointsOrdered = {}
  69. local Checkpoints = {}
  70. local ModeList = {"Instant", "Smooth"}
  71. local SelectedMode = "Instant"
  72. local Running = false
  73. local CustomDelay = 0.35
  74. local AutoLoop = true -- true = loop, false = sekali jalan
  75.  
  76. --========================================================--
  77. -- UI
  78. --========================================================--
  79.  
  80. local ScreenGui = Instance.new("ScreenGui", lp:WaitForChild("PlayerGui"))
  81. ScreenGui.Name = "AutoTP_UI"
  82. ScreenGui.ResetOnSpawn = false
  83.  
  84. local Frame = Instance.new("Frame", ScreenGui)
  85. Frame.Size = UDim2.fromOffset(220, 340)
  86. Frame.Position = UDim2.fromScale(0.5, 0.5)
  87. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  88. Frame.BackgroundColor3 = Color3.fromRGB(22,22,22)
  89. Frame.BorderSizePixel = 0
  90. Instance.new("UICorner", Frame).CornerRadius = UDim.new(0,8)
  91. local dragToggle = false
  92. local dragInput, dragStart, startPos
  93.  
  94. local function updateInput(input)
  95.     local delta = input.Position - dragStart
  96.     Frame.Position = UDim2.new(
  97.         startPos.X.Scale,
  98.         startPos.X.Offset + delta.X,
  99.         startPos.Y.Scale,
  100.         startPos.Y.Offset + delta.Y
  101.     )
  102. end
  103.  
  104. Frame.InputBegan:Connect(function(input)
  105.     if input.UserInputType == Enum.UserInputType.MouseButton1
  106.     or input.UserInputType == Enum.UserInputType.Touch then
  107.         dragToggle = true
  108.         dragStart = input.Position
  109.         startPos = Frame.Position
  110.  
  111.         input.Changed:Connect(function()
  112.             if input.UserInputState == Enum.UserInputState.End then
  113.                 dragToggle = false
  114.             end
  115.         end)
  116.     end
  117. end)
  118.  
  119. Frame.InputChanged:Connect(function(input)
  120.     if input.UserInputType == Enum.UserInputType.MouseMovement
  121.     or input.UserInputType == Enum.UserInputType.Touch then
  122.         dragInput = input
  123.     end
  124. end)
  125.  
  126. RunService.RenderStepped:Connect(function()
  127.     if dragToggle and dragInput then
  128.         updateInput(dragInput)
  129.     end
  130. end)
  131. local UIPad = Instance.new("UIPadding", Frame)
  132. UIPad.PaddingTop = UDim.new(0,6)
  133. UIPad.PaddingBottom = UDim.new(0,6)
  134. -- Title
  135. local Title = Instance.new("TextLabel", Frame)
  136. Title.Size = UDim2.new(1,0,0,30)
  137. Title.Text = "Auto Teleport CP"
  138. Title.TextColor3 = Color3.new(1,1,1)
  139. Title.BackgroundTransparency = 1
  140. Title.Font = Enum.Font.GothamBold
  141. Title.TextSize = 12
  142. local Line = Instance.new("Frame", Frame)
  143. Line.Size = UDim2.new(1,-20,0,1)
  144. Line.Position = UDim2.new(0,10,0,32)
  145. Line.BackgroundColor3 = Color3.fromRGB(60,60,60)
  146. Line.BorderSizePixel = 0
  147. -- Close
  148. local Close = Instance.new("TextButton", Frame)
  149. Close.Size = UDim2.fromOffset(24,24)
  150. Close.Position = UDim2.new(1,-28,0,4)
  151. Close.Text = "X"
  152. Close.Font = Enum.Font.GothamBold
  153. Close.TextSize = 12
  154. Close.TextColor3 = Color3.fromRGB(255,80,80)
  155. Close.BackgroundColor3 = Color3.fromRGB(40,40,40)
  156. Instance.new("UICorner", Close)
  157. Close.MouseButton1Click:Connect(function()
  158.     ScreenGui:Destroy()
  159. end)
  160.  
  161. -- Delay Box
  162. local DelayBox = Instance.new("TextBox", Frame)
  163. DelayBox.Size = UDim2.new(1,-20,0,28)
  164. DelayBox.Position = UDim2.new(0,10,0,52)
  165. DelayBox.PlaceholderText = "Delay (default 0.35)"
  166. DelayBox.Text = ""
  167. DelayBox.TextColor3 = Color3.new(1,1,1)
  168. DelayBox.BackgroundColor3 = Color3.fromRGB(30,30,30)
  169. DelayBox.Font = Enum.Font.Gotham
  170. DelayBox.TextSize = 12
  171. Instance.new("UICorner", DelayBox)
  172.  
  173. DelayBox.FocusLost:Connect(function()
  174.     local v = tonumber(DelayBox.Text)
  175.     if v then CustomDelay = v end
  176. end)
  177.  
  178. -- Mode Dropdown
  179. local ModeBox = Instance.new("TextButton", Frame)
  180. ModeBox.Size = UDim2.new(1,-20,0,30)
  181. ModeBox.Position = UDim2.new(0,10,0,88)
  182. ModeBox.Text = "Mode: "..SelectedMode
  183. ModeBox.TextColor3 = Color3.new(1,1,1)
  184. ModeBox.BackgroundColor3 = Color3.fromRGB(35,35,35)
  185. ModeBox.Font = Enum.Font.Gotham
  186. ModeBox.TextSize = 12
  187. Instance.new("UICorner", ModeBox)
  188. -- Preset Dropdown
  189. local PresetBox = Instance.new("TextButton", Frame)
  190. PresetBox.Size = UDim2.new(1,-20,0,30)
  191. PresetBox.Position = UDim2.new(0,10,0,128)
  192. PresetBox.Text = "Preset: None"
  193. PresetBox.Font = Enum.Font.Gotham
  194. PresetBox.TextSize = 12
  195. PresetBox.TextColor3 = Color3.new(1,1,1)
  196. PresetBox.BackgroundColor3 = Color3.fromRGB(35,35,35)
  197. Instance.new("UICorner", PresetBox)
  198. local PresetFrame = Instance.new("Frame", Frame)
  199. PresetFrame.Visible = false
  200. PresetFrame.Position = UDim2.new(0,10,0,162)
  201. PresetFrame.Size = UDim2.new(1,-20,0,100)
  202. PresetFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
  203. PresetFrame.ZIndex = 20
  204. PresetFrame.ClipsDescendants = true
  205. Instance.new("UICorner", PresetFrame)
  206. local UIScroll = Instance.new("ScrollingFrame", PresetFrame)
  207. UIScroll.Size = UDim2.new(1,-6,1,-6)
  208. UIScroll.Position = UDim2.new(0,3,0,3)
  209. UIScroll.CanvasSize = UDim2.new()
  210. UIScroll.ScrollBarImageTransparency = 0.3
  211. UIScroll.ZIndex = 21
  212. UIScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
  213. UIScroll.BackgroundTransparency = 1
  214. local UIList = Instance.new("UIListLayout", UIScroll)
  215. UIList.Padding = UDim.new(0,3)
  216. PresetBox.MouseButton1Click:Connect(function()
  217.     PresetFrame.Visible = not PresetFrame.Visible
  218. end)
  219. local function reloadPresetUI()
  220.     for _,c in ipairs(UIScroll:GetChildren()) do
  221.         if c:IsA("TextButton") then
  222.             c:Destroy()
  223.         end
  224.     end
  225.     for _,file in ipairs(getPresetFiles()) do
  226.         local btn = Instance.new("TextButton", UIScroll)
  227.         btn.Size = UDim2.new(1,-6,0,24)
  228.         btn.Text = file
  229.         btn.Font = Enum.Font.Gotham
  230.         btn.TextSize = 11
  231.         btn.TextColor3 = Color3.fromRGB(255,255,255)
  232.         btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
  233.         btn.ZIndex = 22 -- ⬅ FIX UTAMA
  234.         Instance.new("UICorner", btn)
  235.         btn.MouseButton1Click:Connect(function()
  236.             if Status then
  237.                 Status.Text = "Preset loaded"
  238.             end
  239.             local ord, data = loadPreset(file)
  240.             if ord and data then
  241.                 CheckpointsOrdered = ord
  242.                 Checkpoints = data
  243.                 CurrentPreset = file
  244.                 PresetBox.Text = "Preset: "..file
  245.                 PresetFrame.Visible = false
  246.             end
  247.         end)
  248.     end
  249. end
  250. reloadPresetUI()
  251. do
  252.     local presets = getPresetFiles()
  253.     if #presets > 0 then
  254.         local ord, data = loadPreset(presets[1])
  255.         if ord and data then
  256.             CheckpointsOrdered = ord
  257.             Checkpoints = data
  258.             CurrentPreset = presets[1]
  259.             PresetBox.Text = "Preset: "..presets[1]
  260.         end
  261.     end
  262. end
  263. local ModeFrame = Instance.new("Frame", Frame)
  264. ModeFrame.Visible = false
  265. ModeFrame.Size = UDim2.new(1,-20,0,80)
  266. ModeFrame.Position = UDim2.new(0,10,0,120)
  267. ModeFrame.ZIndex = 20
  268. ModeFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
  269. ModeFrame.ClipsDescendants = true
  270. Instance.new("UICorner", ModeFrame)
  271.  
  272. for i,mode in ipairs(ModeList) do
  273.     local btn = Instance.new("TextButton", ModeFrame)
  274.     btn.Size = UDim2.new(1,-6,0,22)
  275.     btn.TextSize = 10
  276.     btn.Position = UDim2.new(0,5,0,(i-1)*27)
  277.     btn.Text = mode
  278.     btn.Font = Enum.Font.Gotham
  279.     btn.ZIndex = 21
  280.     btn.TextColor3 = Color3.new(1,1,1)
  281.     btn.AutoButtonColor = true
  282.     btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
  283.     Instance.new("UICorner", btn)
  284.  
  285.     btn.MouseButton1Click:Connect(function()
  286.         SelectedMode = mode
  287.         ModeBox.Text = "Mode: "..mode
  288.         ModeFrame.Visible = false
  289.     end)
  290. end
  291.  
  292. ModeBox.MouseButton1Click:Connect(function()
  293.     ModeFrame.Visible = not ModeFrame.Visible
  294. end)
  295. -- Auto Loop Button
  296. local LoopBtn = Instance.new("TextButton", Frame)
  297. LoopBtn.Position = UDim2.new(0,10,0,175) -- tepat di atas START
  298. LoopBtn.Size = UDim2.new(1,-20,0,30)
  299. LoopBtn.Text = "Loop: ON"
  300. LoopBtn.Font = Enum.Font.Gotham
  301. LoopBtn.TextSize = 12
  302. LoopBtn.TextColor3 = Color3.new(1,1,1)
  303. LoopBtn.BackgroundColor3 = Color3.fromRGB(35,35,35)
  304. Instance.new("UICorner", LoopBtn)
  305.  
  306. LoopBtn.MouseButton1Click:Connect(function()
  307.     AutoLoop = not AutoLoop
  308.     LoopBtn.Text = "Loop: "..(AutoLoop and "ON" or "OFF")
  309. end)
  310.  
  311. -- Start Button
  312. local StartBtn = Instance.new("TextButton", Frame)
  313. StartBtn.Position = UDim2.new(0,10,0,215)
  314. StartBtn.Size = UDim2.new(1,-20,0,34)
  315. StartBtn.Text = "START"
  316. StartBtn.Font = Enum.Font.GothamBold
  317. StartBtn.TextSize = 12
  318. StartBtn.TextColor3 = Color3.new(1,1,1)
  319. StartBtn.BackgroundColor3 = Color3.fromRGB(70,90,120)
  320. Instance.new("UICorner", StartBtn)
  321. StartBtn.MouseEnter:Connect(function()
  322.     StartBtn.BackgroundColor3 = Color3.fromRGB(90,120,160)
  323. end)
  324.  
  325. StartBtn.MouseLeave:Connect(function()
  326.     StartBtn.BackgroundColor3 = Color3.fromRGB(70,90,120)
  327. end)
  328. local ServerBtn = Instance.new("TextButton", Frame)
  329. ServerBtn.Position = UDim2.new(0,10,0,255)
  330. ServerBtn.Size = UDim2.new(1,-20,0,30)
  331. ServerBtn.Text = "NEW SERVER"
  332. ServerBtn.Font = Enum.Font.GothamBold
  333. ServerBtn.TextSize = 12
  334. ServerBtn.TextColor3 = Color3.new(1,1,1)
  335. ServerBtn.BackgroundColor3 = Color3.fromRGB(90,70,70)
  336. Instance.new("UICorner", ServerBtn)
  337. -- Status
  338. local Status = Instance.new("TextLabel", Frame)
  339. Status.Size = UDim2.new(1,-20,0,20)
  340. Status.Position = UDim2.new(0,10,0,295)
  341. Status.TextSize = 10
  342. Status.BackgroundTransparency = 1
  343. Status.TextColor3 = Color3.fromRGB(180,220,180)
  344. Status.Font = Enum.Font.Gotham
  345. Status.Text = "Status: Idle"
  346.  
  347. --========================================================--
  348. -- TELEPORT FUNCTIONS
  349. --========================================================--
  350.  
  351. local function tpInstant(pos)
  352.     hrp.CFrame = CFrame.new(pos)
  353. end
  354.  
  355. local activeTween
  356. local tweenInfo = TweenInfo.new(0.8, Enum.EasingStyle.Linear)
  357. local function tpSmooth(pos)
  358.     if activeTween then
  359.         activeTween:Cancel()
  360.     end
  361.  
  362.     activeTween = TweenService:Create(hrp, tweenInfo, {
  363.         CFrame = CFrame.new(pos)
  364.     })
  365.     activeTween:Play()
  366.     activeTween.Completed:Wait()
  367. end
  368.  
  369. local function stepForwardBackward()
  370.     local look = hrp.CFrame.LookVector
  371.     local ori = hrp.Position
  372.     hrp.CFrame = CFrame.new(ori + look*3)
  373.     task.wait(0.15)
  374.     hrp.CFrame = CFrame.new(ori)
  375. end
  376. --========================================================--
  377. -- SOLO PUBLIC SERVER SYSTEM
  378. --========================================================--
  379.  
  380. local function hopSoloServer()
  381.     if teleporting then return end
  382.     if hopTries >= MAX_HOP_TRIES then
  383.         warn("HopSoloServer: MAX RETRY reached")
  384.         return
  385.     end
  386.  
  387.     hopTries += 1
  388.     teleporting = true
  389.  
  390.     local cursor = ""
  391.     local foundServer = nil
  392.  
  393.     for _ = 1, 5 do -- paging max 5 halaman
  394.         local url = string.format(
  395.             "https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Asc&limit=100%s",
  396.             PlaceId,
  397.             cursor ~= "" and "&cursor="..cursor or ""
  398.         )
  399.  
  400.         local success, response = pcall(function()
  401.             return HttpService:JSONDecode(game:HttpGet(url))
  402.         end)
  403.  
  404.         if success and response and response.data then
  405.             for _, server in ipairs(response.data) do
  406.                 if server.playing < server.maxPlayers
  407.                 and not VisitedServers[server.id] then
  408.                     foundServer = server.id
  409.                     break
  410.                 end
  411.             end
  412.         end
  413.  
  414.         if foundServer then break end
  415.         cursor = response and response.nextPageCursor or nil
  416.         if not cursor then break end
  417.     end
  418.  
  419.     if not foundServer then
  420.         teleporting = false
  421.         warn("HopSoloServer: No server found, retrying...")
  422.         task.delay(2, hopSoloServer)
  423.         return
  424.     end
  425.  
  426.     VisitedServers[foundServer] = true
  427.  
  428.     TeleportService:TeleportToPlaceInstance(
  429.         PlaceId,
  430.         foundServer,
  431.         LocalPlayer
  432.     )
  433. end
  434. TeleportService.TeleportInitFailed:Connect(function()
  435.     teleporting = false
  436. end)
  437.  
  438. Players.PlayerAdded:Connect(function(p)
  439.     if p == LocalPlayer then
  440.         hopTries = 0
  441.         teleporting = false
  442.     end
  443. end)
  444. --========================================================--
  445. -- MAIN LOOP
  446. --========================================================--
  447.  
  448. local function StartTeleport()
  449.     Running = true
  450.     StartBtn.Text = "STOP"
  451.     Status.Text = "Status: Running ("..SelectedMode..")"
  452.  
  453.     while Running do
  454.         for i = 1, #CheckpointsOrdered do
  455.             if not Running then break end    
  456.             local id = CheckpointsOrdered[i]
  457.             local c = Checkpoints[id]
  458.             if c then
  459.                 local pos = Checkpoints[id]
  460.                 if SelectedMode == "Instant" then
  461.                     hrp.CFrame = CFrame.new(pos)
  462.                 else
  463.                     tpSmooth(pos)
  464.                 end  
  465.                 if id == "smt" then
  466.                     stepForwardBackward()
  467.                 end
  468.                 task.wait(CustomDelay)
  469.             end
  470.         end
  471.    
  472.         if not AutoLoop then break end
  473.         task.wait() -- ⬅ yield kecil, penting
  474.     end
  475.     Running = false
  476.     StartBtn.Text = "START"
  477.     Status.Text = "Status: Finished"
  478. end
  479.  
  480. StartBtn.MouseButton1Click:Connect(function()
  481.     if not Running then
  482.         StartTeleport()
  483.     else
  484.         Running = false
  485.         StartBtn.Text = "START"
  486.         Status.Text = "Status: Stopped"
  487.     end
  488. end)
  489. ServerBtn.MouseButton1Click:Connect(function()
  490.     if Running then
  491.         Running = false
  492.         StartBtn.Text = "START"
  493.     end
  494.     hopSoloServer()
  495. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment