Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Full Smooth LoopTP Executor GUI with Behind Offset
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- local loopActive = false
- local targetPlayer
- local speed = 0.2 -- Smoothness
- -- Default behind offset (in studs)
- local behindOffset = -5
- -- ScreenGui
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = player:WaitForChild("PlayerGui")
- -- Main Frame
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0, 280, 0, 220)
- Frame.Position = UDim2.new(0.5, -140, 0.5, -110)
- Frame.BackgroundColor3 = Color3.fromRGB(40,40,40)
- Frame.BorderSizePixel = 0
- Frame.Active = true
- Frame.Draggable = true
- Frame.Parent = ScreenGui
- -- Close Button (X = close completely)
- local CloseButton = Instance.new("TextButton")
- CloseButton.Size = UDim2.new(0,30,0,30)
- CloseButton.Position = UDim2.new(1,-35,0,5)
- CloseButton.BackgroundColor3 = Color3.fromRGB(170,0,0)
- CloseButton.Text = "X"
- CloseButton.TextColor3 = Color3.new(1,1,1)
- CloseButton.Parent = Frame
- -- Minimize Button (-)
- local MinButton = Instance.new("TextButton")
- MinButton.Size = UDim2.new(0,30,0,30)
- MinButton.Position = UDim2.new(1,-70,0,5)
- MinButton.BackgroundColor3 = Color3.fromRGB(255,170,0)
- MinButton.Text = "-"
- MinButton.TextColor3 = Color3.new(1,1,1)
- MinButton.Parent = Frame
- -- Mini GUI button when minimized
- local MiniFrame = Instance.new("TextButton")
- MiniFrame.Size = UDim2.new(0,50,0,50)
- MiniFrame.Position = UDim2.new(0,20,0,20)
- MiniFrame.BackgroundColor3 = Color3.fromRGB(0,170,255)
- MiniFrame.Text = "⚡TP"
- MiniFrame.TextColor3 = Color3.new(1,1,1)
- MiniFrame.Visible = false
- MiniFrame.Parent = ScreenGui
- MiniFrame.Active = true
- MiniFrame.Draggable = true
- -- Target username TextBox
- local TextBox = Instance.new("TextBox")
- TextBox.Size = UDim2.new(0,200,0,30)
- TextBox.Position = UDim2.new(0,25,0,50)
- TextBox.BackgroundColor3 = Color3.fromRGB(60,60,60)
- TextBox.TextColor3 = Color3.new(1,1,1)
- TextBox.PlaceholderText = "Enter username..."
- TextBox.ClearTextOnFocus = false
- TextBox.Parent = Frame
- -- Behind distance TextBox
- local OffsetBox = Instance.new("TextBox")
- OffsetBox.Size = UDim2.new(0,200,0,30)
- OffsetBox.Position = UDim2.new(0,25,0,90)
- OffsetBox.BackgroundColor3 = Color3.fromRGB(60,60,60)
- OffsetBox.TextColor3 = Color3.new(1,1,1)
- OffsetBox.PlaceholderText = "Behind distance (studs, negative)"
- OffsetBox.ClearTextOnFocus = false
- OffsetBox.Text = tostring(behindOffset)
- OffsetBox.Parent = Frame
- -- Start Button
- local StartButton = Instance.new("TextButton")
- StartButton.Size = UDim2.new(0,100,0,30)
- StartButton.Position = UDim2.new(0,25,0,140)
- StartButton.Text = "Start TP"
- StartButton.BackgroundColor3 = Color3.fromRGB(0,170,0)
- StartButton.TextColor3 = Color3.new(1,1,1)
- StartButton.Parent = Frame
- -- Stop Button
- local StopButton = Instance.new("TextButton")
- StopButton.Size = UDim2.new(0,100,0,30)
- StopButton.Position = UDim2.new(0,155,0,140)
- StopButton.Text = "Stop TP"
- StopButton.BackgroundColor3 = Color3.fromRGB(170,0,0)
- StopButton.TextColor3 = Color3.new(1,1,1)
- StopButton.Parent = Frame
- -- Close/Minimize Logic
- CloseButton.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- end)
- MinButton.MouseButton1Click:Connect(function()
- Frame.Visible = false
- MiniFrame.Visible = true
- end)
- MiniFrame.MouseButton1Click:Connect(function()
- Frame.Visible = true
- MiniFrame.Visible = false
- end)
- -- Helper: find player
- local function getPlayer(name)
- for _, p in pairs(Players:GetPlayers()) do
- if p.Name:lower() == name:lower() or p.DisplayName:lower() == name:lower() then
- return p
- end
- end
- return nil
- end
- -- Smooth LoopTP behind target
- local function smoothLoopTP()
- RunService.RenderStepped:Connect(function()
- if loopActive and targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local char = player.Character
- local targetHRP = targetPlayer.Character.HumanoidRootPart
- if char and char:FindFirstChild("HumanoidRootPart") then
- local current = char.HumanoidRootPart.Position
- local offsetNum = tonumber(OffsetBox.Text) or behindOffset
- local offset = targetHRP.CFrame.LookVector * offsetNum
- local goalPos = targetHRP.Position + offset
- char.HumanoidRootPart.CFrame = CFrame.new(current:Lerp(goalPos, speed))
- end
- end
- end)
- end
- -- Buttons actions
- StartButton.MouseButton1Click:Connect(function()
- local name = TextBox.Text
- local target = getPlayer(name)
- if target then
- targetPlayer = target
- loopActive = true
- smoothLoopTP()
- print("Smooth LoopTP started to "..target.Name)
- else
- warn("Player not found")
- end
- end)
- StopButton.MouseButton1Click:Connect(function()
- loopActive = false
- print("LoopTP stopped")
- end)
Advertisement
Add Comment
Please, Sign In to add comment