Advertisement
Guitar1203

Untitled

May 16th, 2025
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.68 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2. local localPlayer = Players.LocalPlayer
  3.  
  4. local teleportInterval = 3
  5. local teleportEnabled = false
  6. local selectedTarget = nil
  7. local inFront = true
  8.  
  9. -- GUI
  10. local gui = Instance.new("ScreenGui", localPlayer:WaitForChild("PlayerGui"))
  11. gui.Name = "TeleportGUI"
  12. gui.ResetOnSpawn = false
  13.  
  14. -- ปุ่ม Menu สำหรับซ่อน/แสดง mainFrame
  15. local menuBtn = Instance.new("TextButton")
  16. menuBtn.Size = UDim2.new(0, 80, 0, 30)
  17. menuBtn.Position = UDim2.new(0, 10, 0, 10)
  18. menuBtn.Text = "Menu"
  19. menuBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  20. menuBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  21. menuBtn.Font = Enum.Font.SourceSansBold
  22. menuBtn.TextSize = 20
  23. menuBtn.Parent = gui
  24.  
  25. local isMainVisible = true
  26.  
  27. local mainFrame = Instance.new("Frame")
  28. mainFrame.Size = UDim2.new(0, 280, 0, 320)
  29. mainFrame.Position = UDim2.new(0.5, -140, 0.5, -160)
  30. mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  31. mainFrame.BorderSizePixel = 0
  32. mainFrame.Active = true
  33. mainFrame.Draggable = true
  34. mainFrame.Parent = gui
  35.  
  36. menuBtn.MouseButton1Click:Connect(function()
  37.     isMainVisible = not isMainVisible
  38.     mainFrame.Visible = isMainVisible
  39. end)
  40.  
  41. -- Title
  42. local title = Instance.new("TextLabel")
  43. title.Size = UDim2.new(1, 0, 0, 30)
  44. title.Text = "Auto Teleport Tool"
  45. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  46. title.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  47. title.Parent = mainFrame
  48.  
  49. -- Dropdown label
  50. local dropdownLabel = Instance.new("TextLabel")
  51. dropdownLabel.Size = UDim2.new(1, -20, 0, 20)
  52. dropdownLabel.Position = UDim2.new(0, 10, 0, 40)
  53. dropdownLabel.Text = "เลือกผู้เล่น:"
  54. dropdownLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  55. dropdownLabel.BackgroundTransparency = 1
  56. dropdownLabel.TextXAlignment = Enum.TextXAlignment.Left
  57. dropdownLabel.Parent = mainFrame
  58.  
  59. -- Dropdown list (Scrollable)
  60. local dropdownFrame = Instance.new("ScrollingFrame")
  61. dropdownFrame.Size = UDim2.new(1, -20, 0, 90)
  62. dropdownFrame.Position = UDim2.new(0, 10, 0, 60)
  63. dropdownFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  64. dropdownFrame.BorderSizePixel = 0
  65. dropdownFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  66. dropdownFrame.ScrollBarThickness = 6
  67. dropdownFrame.Parent = mainFrame
  68.  
  69. local listLayout = Instance.new("UIListLayout")
  70. listLayout.SortOrder = Enum.SortOrder.LayoutOrder
  71. listLayout.Parent = dropdownFrame
  72.  
  73. local padding = Instance.new("UIPadding")
  74. padding.PaddingTop = UDim.new(0, 4)
  75. padding.PaddingBottom = UDim.new(0, 4)
  76. padding.PaddingLeft = UDim.new(0, 4)
  77. padding.PaddingRight = UDim.new(0, 4)
  78. padding.Parent = dropdownFrame
  79.  
  80. -- Interval input
  81. local intervalBox = Instance.new("TextBox")
  82. intervalBox.Size = UDim2.new(1, -20, 0, 30)
  83. intervalBox.Position = UDim2.new(0, 10, 0, 160)
  84. intervalBox.PlaceholderText = "วินาทีในการวาร์ป (default: 3)"
  85. intervalBox.Text = ""
  86. intervalBox.ClearTextOnFocus = false
  87. intervalBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  88. intervalBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  89. intervalBox.Parent = mainFrame
  90.  
  91. -- Front/Back Toggle
  92. local fbToggle = Instance.new("TextButton")
  93. fbToggle.Size = UDim2.new(0.45, -5, 0, 35)
  94. fbToggle.Position = UDim2.new(0.05, 0, 0, 200)
  95. fbToggle.Text = "ตำแหน่ง: ด้านหน้า"
  96. fbToggle.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
  97. fbToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  98. fbToggle.Parent = mainFrame
  99.  
  100. -- Active Toggle
  101. local toggleButton = Instance.new("TextButton")
  102. toggleButton.Size = UDim2.new(0.45, -5, 0, 35)
  103. toggleButton.Position = UDim2.new(0.5, 5, 0, 200)
  104. toggleButton.Text = "Status: Not Active"
  105. toggleButton.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
  106. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  107. toggleButton.Parent = mainFrame
  108.  
  109. -- Destroy Button
  110. local destroyBtn = Instance.new("TextButton")
  111. destroyBtn.Size = UDim2.new(1, -20, 0, 40)
  112. destroyBtn.Position = UDim2.new(0, 10, 0, 250)
  113. destroyBtn.Text = "Destroy Script"
  114. destroyBtn.BackgroundColor3 = Color3.fromRGB(255, 100, 100)
  115. destroyBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  116. destroyBtn.Parent = mainFrame
  117.  
  118. -- ฟังก์ชันรีเฟรชรายชื่อผู้เล่น
  119. local function refreshList()
  120.     for _, child in ipairs(dropdownFrame:GetChildren()) do
  121.         if child:IsA("TextButton") then
  122.             child:Destroy()
  123.         end
  124.     end
  125.  
  126.     local count = 0
  127.     for _, player in ipairs(Players:GetPlayers()) do
  128.         if player ~= localPlayer then
  129.             count = count + 1
  130.             local btn = Instance.new("TextButton")
  131.             btn.Size = UDim2.new(1, -10, 0, 25)
  132.             btn.Text = player.Name
  133.             btn.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  134.             btn.TextColor3 = Color3.fromRGB(255, 255, 255)
  135.             btn.Parent = dropdownFrame
  136.  
  137.             btn.MouseButton1Click:Connect(function()
  138.                 selectedTarget = player
  139.                 dropdownLabel.Text = "เลือกแล้ว: " .. player.Name
  140.             end)
  141.         end
  142.     end
  143.  
  144.     dropdownFrame.CanvasSize = UDim2.new(0, 0, 0, count * 25 + 8)
  145. end
  146.  
  147. Players.PlayerAdded:Connect(refreshList)
  148. Players.PlayerRemoving:Connect(refreshList)
  149. refreshList()
  150.  
  151. -- ป้อนความถี่ teleport
  152. intervalBox.FocusLost:Connect(function()
  153.     local val = tonumber(intervalBox.Text)
  154.     if val and val > 0 then
  155.         teleportInterval = val
  156.     else
  157.         intervalBox.Text = tostring(teleportInterval)
  158.     end
  159. end)
  160.  
  161. -- สลับวาปด้านหน้า/หลัง
  162. fbToggle.MouseButton1Click:Connect(function()
  163.     inFront = not inFront
  164.     fbToggle.Text = "ตำแหน่ง: " .. (inFront and "ด้านหน้า" or "ด้านหลัง")
  165. end)
  166.  
  167. -- เปิด/ปิดระบบ teleport
  168. toggleButton.MouseButton1Click:Connect(function()
  169.     teleportEnabled = not teleportEnabled
  170.     if teleportEnabled then
  171.         toggleButton.Text = "Status: Active"
  172.         toggleButton.BackgroundColor3 = Color3.fromRGB(100, 200, 100)
  173.     else
  174.         toggleButton.Text = "Status: Not Active"
  175.         toggleButton.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
  176.     end
  177. end)
  178.  
  179. -- ปุ่มลบ GUI และ script
  180. destroyBtn.MouseButton1Click:Connect(function()
  181.     teleportEnabled = false
  182.     gui:Destroy()
  183.     script:Destroy()
  184. end)
  185.  
  186. -- Loop Teleport อัตโนมัติ
  187. task.spawn(function()
  188.     while true do
  189.         if teleportEnabled and selectedTarget and selectedTarget.Character and selectedTarget.Character:FindFirstChild("HumanoidRootPart") then
  190.             local char = localPlayer.Character
  191.             if char and char:FindFirstChild("HumanoidRootPart") then
  192.                 local targetRoot = selectedTarget.Character.HumanoidRootPart
  193.                 local offset = inFront and (targetRoot.CFrame.LookVector * 3) or -(targetRoot.CFrame.LookVector * 3)
  194.                 char:MoveTo(targetRoot.Position + offset)
  195.             end
  196.         end
  197.         task.wait(teleportInterval)
  198.     end
  199. end)
  200.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement