Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --==================================================
- -- FULL TP + TWEEN PARTS GUI (AUTO + COOLDOWN)
- -- HP & PC | FLOATING BUTTON | MUAT
- --==================================================
- local Players = game:GetService("Players")
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local player = Players.LocalPlayer
- --==================================================
- -- CHARACTER
- --==================================================
- local function getHRP()
- local char = player.Character or player.CharacterAdded:Wait()
- return char:WaitForChild("HumanoidRootPart")
- end
- --==================================================
- -- GUI ROOT
- --==================================================
- local gui = Instance.new("ScreenGui")
- gui.Name = "TP_GUI_FULL"
- gui.ResetOnSpawn = false
- gui.Parent = player:WaitForChild("PlayerGui")
- --==================================================
- -- FLOATING BUTTON
- --==================================================
- local floatBtn = Instance.new("TextButton", gui)
- floatBtn.Size = UDim2.new(0,52,0,52)
- floatBtn.Position = UDim2.new(0,20,0.5,-26)
- floatBtn.Text = "TP"
- floatBtn.TextScaled = true
- floatBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
- floatBtn.TextColor3 = Color3.new(1,1,1)
- floatBtn.BorderSizePixel = 0
- Instance.new("UICorner", floatBtn).CornerRadius = UDim.new(1,0)
- -- drag (PC + HP)
- do
- local drag, offset
- floatBtn.InputBegan:Connect(function(i)
- if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
- drag = true
- offset = floatBtn.Position - UDim2.fromOffset(i.Position.X,i.Position.Y)
- end
- end)
- UserInputService.InputEnded:Connect(function(i)
- if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
- drag = false
- end
- end)
- UserInputService.InputChanged:Connect(function(i)
- if drag and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then
- floatBtn.Position = offset + UDim2.fromOffset(i.Position.X,i.Position.Y)
- end
- end)
- end
- --==================================================
- -- MAIN GUI
- --==================================================
- local main = Instance.new("Frame", gui)
- main.Size = UDim2.new(0,250,0,390)
- main.Position = UDim2.new(0.5,-125,0.5,-195)
- main.Visible = false
- main.BackgroundColor3 = Color3.fromRGB(35,35,35)
- main.Active = true
- main.Draggable = true
- floatBtn.MouseButton1Click:Connect(function()
- main.Visible = not main.Visible
- end)
- -- auto scale HP
- local scale = Instance.new("UIScale", main)
- scale.Scale = UserInputService.TouchEnabled and 0.8 or 1
- --==================================================
- -- TITLE
- --==================================================
- local title = Instance.new("TextLabel", main)
- title.Size = UDim2.new(1,0,0,28)
- title.BackgroundColor3 = Color3.fromRGB(20,20,20)
- title.Text = "TP PARTS"
- title.TextColor3 = Color3.new(1,1,1)
- title.TextScaled = true
- --==================================================
- -- SEARCH
- --==================================================
- local search = Instance.new("TextBox", main)
- search.Size = UDim2.new(1,-10,0,24)
- search.Position = UDim2.new(0,5,0,32)
- search.PlaceholderText = "Search parts..."
- search.BackgroundColor3 = Color3.fromRGB(50,50,50)
- search.TextColor3 = Color3.new(1,1,1)
- --==================================================
- -- LIST
- --==================================================
- local list = Instance.new("ScrollingFrame", main)
- list.Size = UDim2.new(1,-10,0,180)
- list.Position = UDim2.new(0,5,0,60)
- list.BackgroundTransparency = 1
- list.ScrollBarThickness = 5
- list.CanvasSize = UDim2.new(0,0,0,0)
- local layout = Instance.new("UIListLayout", list)
- layout.Padding = UDim.new(0,4)
- layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- list.CanvasSize = UDim2.new(0,0,0,layout.AbsoluteContentSize.Y+5)
- end)
- --==================================================
- -- STATE
- --==================================================
- local selectedPart
- local buttons = {}
- local autoTP = false
- local autoTween = false
- local cooldownOn = false
- local cooldown = 1
- --==================================================
- -- PART SYSTEM
- --==================================================
- local function addPart(p)
- if not p:IsA("BasePart") then return end
- if buttons[p] then return end
- local b = Instance.new("TextButton", list)
- b.Size = UDim2.new(1,-6,0,22)
- b.BackgroundColor3 = Color3.fromRGB(70,70,70)
- b.TextColor3 = Color3.new(1,1,1)
- b.Text = p.Name
- b.MouseButton1Click:Connect(function()
- selectedPart = p
- end)
- buttons[p] = b
- end
- local function removePart(p)
- if buttons[p] then
- buttons[p]:Destroy()
- buttons[p] = nil
- end
- if selectedPart == p then selectedPart = nil end
- end
- for _,v in ipairs(workspace:GetDescendants()) do
- addPart(v)
- end
- workspace.DescendantAdded:Connect(addPart)
- workspace.DescendantRemoving:Connect(removePart)
- -- search
- search:GetPropertyChangedSignal("Text"):Connect(function()
- local q = search.Text:lower()
- for p,b in pairs(buttons) do
- b.Visible = q == "" or p.Name:lower():find(q)
- end
- end)
- --==================================================
- -- BUTTONS (MUAT)
- --==================================================
- local function makeBtn(text,y)
- local b = Instance.new("TextButton", main)
- b.Size = UDim2.new(1,-10,0,26)
- b.Position = UDim2.new(0,5,0,y)
- b.BackgroundColor3 = Color3.fromRGB(65,65,65)
- b.TextColor3 = Color3.new(1,1,1)
- b.Text = text
- return b
- end
- local tpBtn = makeBtn("TP",245)
- local tweenBtn = makeBtn("TWEEN",273)
- local autoTPBtn = makeBtn("AUTO TP : OFF",301)
- local autoTweenBtn = makeBtn("AUTO TWEEN : OFF",329)
- local cdBtn = makeBtn("COOLDOWN : OFF",357)
- -- cooldown input
- local cdInput = Instance.new("TextBox", main)
- cdInput.Size = UDim2.new(1,-10,0,22)
- cdInput.Position = UDim2.new(0,5,0,385)
- cdInput.PlaceholderText = "Cooldown (seconds)"
- cdInput.Text = "1"
- cdInput.BackgroundColor3 = Color3.fromRGB(50,50,50)
- cdInput.TextColor3 = Color3.new(1,1,1)
- --==================================================
- -- ACTIONS
- --==================================================
- local function tp()
- if selectedPart then
- getHRP().CFrame = selectedPart.CFrame + Vector3.new(0,3,0)
- end
- end
- local function tween()
- if selectedPart then
- TweenService:Create(
- getHRP(),
- TweenInfo.new(0.5,Enum.EasingStyle.Quad),
- {CFrame = selectedPart.CFrame + Vector3.new(0,3,0)}
- ):Play()
- end
- end
- tpBtn.MouseButton1Click:Connect(tp)
- tweenBtn.MouseButton1Click:Connect(tween)
- autoTPBtn.MouseButton1Click:Connect(function()
- autoTP = not autoTP
- autoTPBtn.Text = autoTP and "AUTO TP : ON" or "AUTO TP : OFF"
- end)
- autoTweenBtn.MouseButton1Click:Connect(function()
- autoTween = not autoTween
- autoTweenBtn.Text = autoTween and "AUTO TWEEN : ON" or "AUTO TWEEN : OFF"
- end)
- cdBtn.MouseButton1Click:Connect(function()
- cooldownOn = not cooldownOn
- cdBtn.Text = cooldownOn and "COOLDOWN : ON" or "COOLDOWN : OFF"
- end)
- cdInput:GetPropertyChangedSignal("Text"):Connect(function()
- cooldown = tonumber(cdInput.Text) or 1
- end)
- --==================================================
- -- LOOPS
- --==================================================
- task.spawn(function()
- while true do
- task.wait(cooldownOn and cooldown or 0.1)
- if autoTP then tp() end
- end
- end)
- task.spawn(function()
- while true do
- task.wait(cooldownOn and cooldown or 0.2)
- if autoTween then tween() end
- end
- end)
- print("✅ TP + TWEEN + AUTO + COOLDOWN LOADED")
Advertisement
Add Comment
Please, Sign In to add comment