SALENDRA

Tp part -good for auto farm

Dec 29th, 2025
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.61 KB | Source Code | 0 0
  1. --==================================================
  2. -- FULL TP + TWEEN PARTS GUI (AUTO + COOLDOWN)
  3. -- HP & PC | FLOATING BUTTON | MUAT
  4. --==================================================
  5.  
  6. local Players = game:GetService("Players")
  7. local TweenService = game:GetService("TweenService")
  8. local UserInputService = game:GetService("UserInputService")
  9. local player = Players.LocalPlayer
  10.  
  11. --==================================================
  12. -- CHARACTER
  13. --==================================================
  14. local function getHRP()
  15.     local char = player.Character or player.CharacterAdded:Wait()
  16.     return char:WaitForChild("HumanoidRootPart")
  17. end
  18.  
  19. --==================================================
  20. -- GUI ROOT
  21. --==================================================
  22. local gui = Instance.new("ScreenGui")
  23. gui.Name = "TP_GUI_FULL"
  24. gui.ResetOnSpawn = false
  25. gui.Parent = player:WaitForChild("PlayerGui")
  26.  
  27. --==================================================
  28. -- FLOATING BUTTON
  29. --==================================================
  30. local floatBtn = Instance.new("TextButton", gui)
  31. floatBtn.Size = UDim2.new(0,52,0,52)
  32. floatBtn.Position = UDim2.new(0,20,0.5,-26)
  33. floatBtn.Text = "TP"
  34. floatBtn.TextScaled = true
  35. floatBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
  36. floatBtn.TextColor3 = Color3.new(1,1,1)
  37. floatBtn.BorderSizePixel = 0
  38. Instance.new("UICorner", floatBtn).CornerRadius = UDim.new(1,0)
  39.  
  40. -- drag (PC + HP)
  41. do
  42.     local drag, offset
  43.     floatBtn.InputBegan:Connect(function(i)
  44.         if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
  45.             drag = true
  46.             offset = floatBtn.Position - UDim2.fromOffset(i.Position.X,i.Position.Y)
  47.         end
  48.     end)
  49.     UserInputService.InputEnded:Connect(function(i)
  50.         if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
  51.             drag = false
  52.         end
  53.     end)
  54.     UserInputService.InputChanged:Connect(function(i)
  55.         if drag and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then
  56.             floatBtn.Position = offset + UDim2.fromOffset(i.Position.X,i.Position.Y)
  57.         end
  58.     end)
  59. end
  60.  
  61. --==================================================
  62. -- MAIN GUI
  63. --==================================================
  64. local main = Instance.new("Frame", gui)
  65. main.Size = UDim2.new(0,250,0,390)
  66. main.Position = UDim2.new(0.5,-125,0.5,-195)
  67. main.Visible = false
  68. main.BackgroundColor3 = Color3.fromRGB(35,35,35)
  69. main.Active = true
  70. main.Draggable = true
  71.  
  72. floatBtn.MouseButton1Click:Connect(function()
  73.     main.Visible = not main.Visible
  74. end)
  75.  
  76. -- auto scale HP
  77. local scale = Instance.new("UIScale", main)
  78. scale.Scale = UserInputService.TouchEnabled and 0.8 or 1
  79.  
  80. --==================================================
  81. -- TITLE
  82. --==================================================
  83. local title = Instance.new("TextLabel", main)
  84. title.Size = UDim2.new(1,0,0,28)
  85. title.BackgroundColor3 = Color3.fromRGB(20,20,20)
  86. title.Text = "TP PARTS"
  87. title.TextColor3 = Color3.new(1,1,1)
  88. title.TextScaled = true
  89.  
  90. --==================================================
  91. -- SEARCH
  92. --==================================================
  93. local search = Instance.new("TextBox", main)
  94. search.Size = UDim2.new(1,-10,0,24)
  95. search.Position = UDim2.new(0,5,0,32)
  96. search.PlaceholderText = "Search parts..."
  97. search.BackgroundColor3 = Color3.fromRGB(50,50,50)
  98. search.TextColor3 = Color3.new(1,1,1)
  99.  
  100. --==================================================
  101. -- LIST
  102. --==================================================
  103. local list = Instance.new("ScrollingFrame", main)
  104. list.Size = UDim2.new(1,-10,0,180)
  105. list.Position = UDim2.new(0,5,0,60)
  106. list.BackgroundTransparency = 1
  107. list.ScrollBarThickness = 5
  108. list.CanvasSize = UDim2.new(0,0,0,0)
  109.  
  110. local layout = Instance.new("UIListLayout", list)
  111. layout.Padding = UDim.new(0,4)
  112. layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  113.     list.CanvasSize = UDim2.new(0,0,0,layout.AbsoluteContentSize.Y+5)
  114. end)
  115.  
  116. --==================================================
  117. -- STATE
  118. --==================================================
  119. local selectedPart
  120. local buttons = {}
  121.  
  122. local autoTP = false
  123. local autoTween = false
  124. local cooldownOn = false
  125. local cooldown = 1
  126.  
  127. --==================================================
  128. -- PART SYSTEM
  129. --==================================================
  130. local function addPart(p)
  131.     if not p:IsA("BasePart") then return end
  132.     if buttons[p] then return end
  133.  
  134.     local b = Instance.new("TextButton", list)
  135.     b.Size = UDim2.new(1,-6,0,22)
  136.     b.BackgroundColor3 = Color3.fromRGB(70,70,70)
  137.     b.TextColor3 = Color3.new(1,1,1)
  138.     b.Text = p.Name
  139.  
  140.     b.MouseButton1Click:Connect(function()
  141.         selectedPart = p
  142.     end)
  143.  
  144.     buttons[p] = b
  145. end
  146.  
  147. local function removePart(p)
  148.     if buttons[p] then
  149.         buttons[p]:Destroy()
  150.         buttons[p] = nil
  151.     end
  152.     if selectedPart == p then selectedPart = nil end
  153. end
  154.  
  155. for _,v in ipairs(workspace:GetDescendants()) do
  156.     addPart(v)
  157. end
  158. workspace.DescendantAdded:Connect(addPart)
  159. workspace.DescendantRemoving:Connect(removePart)
  160.  
  161. -- search
  162. search:GetPropertyChangedSignal("Text"):Connect(function()
  163.     local q = search.Text:lower()
  164.     for p,b in pairs(buttons) do
  165.         b.Visible = q == "" or p.Name:lower():find(q)
  166.     end
  167. end)
  168.  
  169. --==================================================
  170. -- BUTTONS (MUAT)
  171. --==================================================
  172. local function makeBtn(text,y)
  173.     local b = Instance.new("TextButton", main)
  174.     b.Size = UDim2.new(1,-10,0,26)
  175.     b.Position = UDim2.new(0,5,0,y)
  176.     b.BackgroundColor3 = Color3.fromRGB(65,65,65)
  177.     b.TextColor3 = Color3.new(1,1,1)
  178.     b.Text = text
  179.     return b
  180. end
  181.  
  182. local tpBtn        = makeBtn("TP",245)
  183. local tweenBtn     = makeBtn("TWEEN",273)
  184. local autoTPBtn    = makeBtn("AUTO TP : OFF",301)
  185. local autoTweenBtn = makeBtn("AUTO TWEEN : OFF",329)
  186. local cdBtn        = makeBtn("COOLDOWN : OFF",357)
  187.  
  188. -- cooldown input
  189. local cdInput = Instance.new("TextBox", main)
  190. cdInput.Size = UDim2.new(1,-10,0,22)
  191. cdInput.Position = UDim2.new(0,5,0,385)
  192. cdInput.PlaceholderText = "Cooldown (seconds)"
  193. cdInput.Text = "1"
  194. cdInput.BackgroundColor3 = Color3.fromRGB(50,50,50)
  195. cdInput.TextColor3 = Color3.new(1,1,1)
  196.  
  197. --==================================================
  198. -- ACTIONS
  199. --==================================================
  200. local function tp()
  201.     if selectedPart then
  202.         getHRP().CFrame = selectedPart.CFrame + Vector3.new(0,3,0)
  203.     end
  204. end
  205.  
  206. local function tween()
  207.     if selectedPart then
  208.         TweenService:Create(
  209.             getHRP(),
  210.             TweenInfo.new(0.5,Enum.EasingStyle.Quad),
  211.             {CFrame = selectedPart.CFrame + Vector3.new(0,3,0)}
  212.         ):Play()
  213.     end
  214. end
  215.  
  216. tpBtn.MouseButton1Click:Connect(tp)
  217. tweenBtn.MouseButton1Click:Connect(tween)
  218.  
  219. autoTPBtn.MouseButton1Click:Connect(function()
  220.     autoTP = not autoTP
  221.     autoTPBtn.Text = autoTP and "AUTO TP : ON" or "AUTO TP : OFF"
  222. end)
  223.  
  224. autoTweenBtn.MouseButton1Click:Connect(function()
  225.     autoTween = not autoTween
  226.     autoTweenBtn.Text = autoTween and "AUTO TWEEN : ON" or "AUTO TWEEN : OFF"
  227. end)
  228.  
  229. cdBtn.MouseButton1Click:Connect(function()
  230.     cooldownOn = not cooldownOn
  231.     cdBtn.Text = cooldownOn and "COOLDOWN : ON" or "COOLDOWN : OFF"
  232. end)
  233.  
  234. cdInput:GetPropertyChangedSignal("Text"):Connect(function()
  235.     cooldown = tonumber(cdInput.Text) or 1
  236. end)
  237.  
  238. --==================================================
  239. -- LOOPS
  240. --==================================================
  241. task.spawn(function()
  242.     while true do
  243.         task.wait(cooldownOn and cooldown or 0.1)
  244.         if autoTP then tp() end
  245.     end
  246. end)
  247.  
  248. task.spawn(function()
  249.     while true do
  250.         task.wait(cooldownOn and cooldown or 0.2)
  251.         if autoTween then tween() end
  252.     end
  253. end)
  254.  
  255. print("✅ TP + TWEEN + AUTO + COOLDOWN LOADED")
  256.  
Tags: TP teleport part
Advertisement
Add Comment
Please, Sign In to add comment