Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// AUTO TELEPORT CP ROUTE UI (Dark Theme)
- --// By Kitoo for ILHAM (Full Version)
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local TeleportService = game:GetService("TeleportService")
- local HttpService = game:GetService("HttpService")
- local UIS = game:GetService("UserInputService")
- local lp = Players.LocalPlayer
- local char = lp.Character or lp.CharacterAdded:Wait()
- local hrp = char:WaitForChild("HumanoidRootPart")
- lp.CharacterAdded:Connect(function(c)
- char = c
- hrp = char:WaitForChild("HumanoidRootPart")
- end)
- local LocalPlayer = Players.LocalPlayer
- local PlaceId = game.PlaceId
- local PRESET_FOLDER = ".Cordinat"
- local CurrentPreset = nil
- local MAX_HOP_TRIES = 5
- local hopTries = 0
- local teleporting = false
- local VisitedServers = {}
- local function getPresetFiles()
- local files = {}
- if listfiles and isfolder and isfolder(PRESET_FOLDER) then
- for _,f in ipairs(listfiles(PRESET_FOLDER)) do
- if f:sub(-5) == ".json" then
- table.insert(files, f:match("[^/]+$"))
- end
- end
- end
- table.sort(files)
- return files
- end
- local function loadPreset(fileName)
- local path = PRESET_FOLDER.."/"..fileName
- if not isfile(path) then return end
- local ok, raw = pcall(function()
- return HttpService:JSONDecode(readfile(path))
- end)
- if not ok or type(raw) ~= "table" then return end
- local ordered, data = {}, {}
- for id,vec in pairs(raw) do
- data[id] = Vector3.new(vec[1], vec[2], vec[3])
- if id ~= "smt" then
- table.insert(ordered, id)
- end
- end
- table.sort(ordered, function(a,b)
- return tonumber(a) < tonumber(b)
- end)
- if raw["smt"] then
- table.insert(ordered, "smt")
- end
- return ordered, data
- end
- --========================================================--
- -- DATA CHECKPOINT
- --========================================================--
- local CheckpointsOrdered = {}
- local Checkpoints = {}
- local ModeList = {"Instant", "Smooth"}
- local SelectedMode = "Instant"
- local Running = false
- local CustomDelay = 0.35
- local AutoLoop = true -- true = loop, false = sekali jalan
- --========================================================--
- -- UI
- --========================================================--
- local ScreenGui = Instance.new("ScreenGui", lp:WaitForChild("PlayerGui"))
- ScreenGui.Name = "AutoTP_UI"
- ScreenGui.ResetOnSpawn = false
- local Frame = Instance.new("Frame", ScreenGui)
- Frame.Size = UDim2.fromOffset(220, 340)
- Frame.Position = UDim2.fromScale(0.5, 0.5)
- Frame.AnchorPoint = Vector2.new(0.5, 0.5)
- Frame.BackgroundColor3 = Color3.fromRGB(22,22,22)
- Frame.BorderSizePixel = 0
- Instance.new("UICorner", Frame).CornerRadius = UDim.new(0,8)
- local dragToggle = false
- local dragInput, dragStart, startPos
- local function updateInput(input)
- 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
- Frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1
- or input.UserInputType == Enum.UserInputType.Touch then
- dragToggle = true
- dragStart = input.Position
- startPos = Frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragToggle = false
- end
- end)
- end
- end)
- Frame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement
- or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- RunService.RenderStepped:Connect(function()
- if dragToggle and dragInput then
- updateInput(dragInput)
- end
- end)
- local UIPad = Instance.new("UIPadding", Frame)
- UIPad.PaddingTop = UDim.new(0,6)
- UIPad.PaddingBottom = UDim.new(0,6)
- -- Title
- local Title = Instance.new("TextLabel", Frame)
- Title.Size = UDim2.new(1,0,0,30)
- Title.Text = "Auto Teleport CP"
- Title.TextColor3 = Color3.new(1,1,1)
- Title.BackgroundTransparency = 1
- Title.Font = Enum.Font.GothamBold
- Title.TextSize = 12
- local Line = Instance.new("Frame", Frame)
- Line.Size = UDim2.new(1,-20,0,1)
- Line.Position = UDim2.new(0,10,0,32)
- Line.BackgroundColor3 = Color3.fromRGB(60,60,60)
- Line.BorderSizePixel = 0
- -- Close
- local Close = Instance.new("TextButton", Frame)
- Close.Size = UDim2.fromOffset(24,24)
- Close.Position = UDim2.new(1,-28,0,4)
- Close.Text = "X"
- Close.Font = Enum.Font.GothamBold
- Close.TextSize = 12
- Close.TextColor3 = Color3.fromRGB(255,80,80)
- Close.BackgroundColor3 = Color3.fromRGB(40,40,40)
- Instance.new("UICorner", Close)
- Close.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- end)
- -- Delay Box
- local DelayBox = Instance.new("TextBox", Frame)
- DelayBox.Size = UDim2.new(1,-20,0,28)
- DelayBox.Position = UDim2.new(0,10,0,52)
- DelayBox.PlaceholderText = "Delay (default 0.35)"
- DelayBox.Text = ""
- DelayBox.TextColor3 = Color3.new(1,1,1)
- DelayBox.BackgroundColor3 = Color3.fromRGB(30,30,30)
- DelayBox.Font = Enum.Font.Gotham
- DelayBox.TextSize = 12
- Instance.new("UICorner", DelayBox)
- DelayBox.FocusLost:Connect(function()
- local v = tonumber(DelayBox.Text)
- if v then CustomDelay = v end
- end)
- -- Mode Dropdown
- local ModeBox = Instance.new("TextButton", Frame)
- ModeBox.Size = UDim2.new(1,-20,0,30)
- ModeBox.Position = UDim2.new(0,10,0,88)
- ModeBox.Text = "Mode: "..SelectedMode
- ModeBox.TextColor3 = Color3.new(1,1,1)
- ModeBox.BackgroundColor3 = Color3.fromRGB(35,35,35)
- ModeBox.Font = Enum.Font.Gotham
- ModeBox.TextSize = 12
- Instance.new("UICorner", ModeBox)
- -- Preset Dropdown
- local PresetBox = Instance.new("TextButton", Frame)
- PresetBox.Size = UDim2.new(1,-20,0,30)
- PresetBox.Position = UDim2.new(0,10,0,128)
- PresetBox.Text = "Preset: None"
- PresetBox.Font = Enum.Font.Gotham
- PresetBox.TextSize = 12
- PresetBox.TextColor3 = Color3.new(1,1,1)
- PresetBox.BackgroundColor3 = Color3.fromRGB(35,35,35)
- Instance.new("UICorner", PresetBox)
- local PresetFrame = Instance.new("Frame", Frame)
- PresetFrame.Visible = false
- PresetFrame.Position = UDim2.new(0,10,0,162)
- PresetFrame.Size = UDim2.new(1,-20,0,100)
- PresetFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
- PresetFrame.ZIndex = 20
- PresetFrame.ClipsDescendants = true
- Instance.new("UICorner", PresetFrame)
- local UIScroll = Instance.new("ScrollingFrame", PresetFrame)
- UIScroll.Size = UDim2.new(1,-6,1,-6)
- UIScroll.Position = UDim2.new(0,3,0,3)
- UIScroll.CanvasSize = UDim2.new()
- UIScroll.ScrollBarImageTransparency = 0.3
- UIScroll.ZIndex = 21
- UIScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
- UIScroll.BackgroundTransparency = 1
- local UIList = Instance.new("UIListLayout", UIScroll)
- UIList.Padding = UDim.new(0,3)
- PresetBox.MouseButton1Click:Connect(function()
- PresetFrame.Visible = not PresetFrame.Visible
- end)
- local function reloadPresetUI()
- for _,c in ipairs(UIScroll:GetChildren()) do
- if c:IsA("TextButton") then
- c:Destroy()
- end
- end
- for _,file in ipairs(getPresetFiles()) do
- local btn = Instance.new("TextButton", UIScroll)
- btn.Size = UDim2.new(1,-6,0,24)
- btn.Text = file
- btn.Font = Enum.Font.Gotham
- btn.TextSize = 11
- btn.TextColor3 = Color3.fromRGB(255,255,255)
- btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- btn.ZIndex = 22 -- ⬅ FIX UTAMA
- Instance.new("UICorner", btn)
- btn.MouseButton1Click:Connect(function()
- if Status then
- Status.Text = "Preset loaded"
- end
- local ord, data = loadPreset(file)
- if ord and data then
- CheckpointsOrdered = ord
- Checkpoints = data
- CurrentPreset = file
- PresetBox.Text = "Preset: "..file
- PresetFrame.Visible = false
- end
- end)
- end
- end
- reloadPresetUI()
- do
- local presets = getPresetFiles()
- if #presets > 0 then
- local ord, data = loadPreset(presets[1])
- if ord and data then
- CheckpointsOrdered = ord
- Checkpoints = data
- CurrentPreset = presets[1]
- PresetBox.Text = "Preset: "..presets[1]
- end
- end
- end
- local ModeFrame = Instance.new("Frame", Frame)
- ModeFrame.Visible = false
- ModeFrame.Size = UDim2.new(1,-20,0,80)
- ModeFrame.Position = UDim2.new(0,10,0,120)
- ModeFrame.ZIndex = 20
- ModeFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
- ModeFrame.ClipsDescendants = true
- Instance.new("UICorner", ModeFrame)
- for i,mode in ipairs(ModeList) do
- local btn = Instance.new("TextButton", ModeFrame)
- btn.Size = UDim2.new(1,-6,0,22)
- btn.TextSize = 10
- btn.Position = UDim2.new(0,5,0,(i-1)*27)
- btn.Text = mode
- btn.Font = Enum.Font.Gotham
- btn.ZIndex = 21
- btn.TextColor3 = Color3.new(1,1,1)
- btn.AutoButtonColor = true
- btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- Instance.new("UICorner", btn)
- btn.MouseButton1Click:Connect(function()
- SelectedMode = mode
- ModeBox.Text = "Mode: "..mode
- ModeFrame.Visible = false
- end)
- end
- ModeBox.MouseButton1Click:Connect(function()
- ModeFrame.Visible = not ModeFrame.Visible
- end)
- -- Auto Loop Button
- local LoopBtn = Instance.new("TextButton", Frame)
- LoopBtn.Position = UDim2.new(0,10,0,175) -- tepat di atas START
- LoopBtn.Size = UDim2.new(1,-20,0,30)
- LoopBtn.Text = "Loop: ON"
- LoopBtn.Font = Enum.Font.Gotham
- LoopBtn.TextSize = 12
- LoopBtn.TextColor3 = Color3.new(1,1,1)
- LoopBtn.BackgroundColor3 = Color3.fromRGB(35,35,35)
- Instance.new("UICorner", LoopBtn)
- LoopBtn.MouseButton1Click:Connect(function()
- AutoLoop = not AutoLoop
- LoopBtn.Text = "Loop: "..(AutoLoop and "ON" or "OFF")
- end)
- -- Start Button
- local StartBtn = Instance.new("TextButton", Frame)
- StartBtn.Position = UDim2.new(0,10,0,215)
- StartBtn.Size = UDim2.new(1,-20,0,34)
- StartBtn.Text = "START"
- StartBtn.Font = Enum.Font.GothamBold
- StartBtn.TextSize = 12
- StartBtn.TextColor3 = Color3.new(1,1,1)
- StartBtn.BackgroundColor3 = Color3.fromRGB(70,90,120)
- Instance.new("UICorner", StartBtn)
- StartBtn.MouseEnter:Connect(function()
- StartBtn.BackgroundColor3 = Color3.fromRGB(90,120,160)
- end)
- StartBtn.MouseLeave:Connect(function()
- StartBtn.BackgroundColor3 = Color3.fromRGB(70,90,120)
- end)
- local ServerBtn = Instance.new("TextButton", Frame)
- ServerBtn.Position = UDim2.new(0,10,0,255)
- ServerBtn.Size = UDim2.new(1,-20,0,30)
- ServerBtn.Text = "NEW SERVER"
- ServerBtn.Font = Enum.Font.GothamBold
- ServerBtn.TextSize = 12
- ServerBtn.TextColor3 = Color3.new(1,1,1)
- ServerBtn.BackgroundColor3 = Color3.fromRGB(90,70,70)
- Instance.new("UICorner", ServerBtn)
- -- Status
- local Status = Instance.new("TextLabel", Frame)
- Status.Size = UDim2.new(1,-20,0,20)
- Status.Position = UDim2.new(0,10,0,295)
- Status.TextSize = 10
- Status.BackgroundTransparency = 1
- Status.TextColor3 = Color3.fromRGB(180,220,180)
- Status.Font = Enum.Font.Gotham
- Status.Text = "Status: Idle"
- --========================================================--
- -- TELEPORT FUNCTIONS
- --========================================================--
- local function tpInstant(pos)
- hrp.CFrame = CFrame.new(pos)
- end
- local activeTween
- local tweenInfo = TweenInfo.new(0.8, Enum.EasingStyle.Linear)
- local function tpSmooth(pos)
- if activeTween then
- activeTween:Cancel()
- end
- activeTween = TweenService:Create(hrp, tweenInfo, {
- CFrame = CFrame.new(pos)
- })
- activeTween:Play()
- activeTween.Completed:Wait()
- end
- local function stepForwardBackward()
- local look = hrp.CFrame.LookVector
- local ori = hrp.Position
- hrp.CFrame = CFrame.new(ori + look*3)
- task.wait(0.15)
- hrp.CFrame = CFrame.new(ori)
- end
- --========================================================--
- -- SOLO PUBLIC SERVER SYSTEM
- --========================================================--
- local function hopSoloServer()
- if teleporting then return end
- if hopTries >= MAX_HOP_TRIES then
- warn("HopSoloServer: MAX RETRY reached")
- return
- end
- hopTries += 1
- teleporting = true
- local cursor = ""
- local foundServer = nil
- for _ = 1, 5 do -- paging max 5 halaman
- local url = string.format(
- "https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Asc&limit=100%s",
- PlaceId,
- cursor ~= "" and "&cursor="..cursor or ""
- )
- local success, response = pcall(function()
- return HttpService:JSONDecode(game:HttpGet(url))
- end)
- if success and response and response.data then
- for _, server in ipairs(response.data) do
- if server.playing < server.maxPlayers
- and not VisitedServers[server.id] then
- foundServer = server.id
- break
- end
- end
- end
- if foundServer then break end
- cursor = response and response.nextPageCursor or nil
- if not cursor then break end
- end
- if not foundServer then
- teleporting = false
- warn("HopSoloServer: No server found, retrying...")
- task.delay(2, hopSoloServer)
- return
- end
- VisitedServers[foundServer] = true
- TeleportService:TeleportToPlaceInstance(
- PlaceId,
- foundServer,
- LocalPlayer
- )
- end
- TeleportService.TeleportInitFailed:Connect(function()
- teleporting = false
- end)
- Players.PlayerAdded:Connect(function(p)
- if p == LocalPlayer then
- hopTries = 0
- teleporting = false
- end
- end)
- --========================================================--
- -- MAIN LOOP
- --========================================================--
- local function StartTeleport()
- Running = true
- StartBtn.Text = "STOP"
- Status.Text = "Status: Running ("..SelectedMode..")"
- while Running do
- for i = 1, #CheckpointsOrdered do
- if not Running then break end
- local id = CheckpointsOrdered[i]
- local c = Checkpoints[id]
- if c then
- local pos = Checkpoints[id]
- if SelectedMode == "Instant" then
- hrp.CFrame = CFrame.new(pos)
- else
- tpSmooth(pos)
- end
- if id == "smt" then
- stepForwardBackward()
- end
- task.wait(CustomDelay)
- end
- end
- if not AutoLoop then break end
- task.wait() -- ⬅ yield kecil, penting
- end
- Running = false
- StartBtn.Text = "START"
- Status.Text = "Status: Finished"
- end
- StartBtn.MouseButton1Click:Connect(function()
- if not Running then
- StartTeleport()
- else
- Running = false
- StartBtn.Text = "START"
- Status.Text = "Status: Stopped"
- end
- end)
- ServerBtn.MouseButton1Click:Connect(function()
- if Running then
- Running = false
- StartBtn.Text = "START"
- end
- hopSoloServer()
- end)
Advertisement
Add Comment
Please, Sign In to add comment