Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "TPFlingGui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Main frame
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 250, 0, 120)
- frame.Position = UDim2.new(0.5, -125, 0.5, -60)
- frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- frame.Parent = screenGui
- -- Title
- local title = Instance.new("TextLabel")
- title.Text = "TP + Fling GUI"
- title.Size = UDim2.new(1, 0, 0, 30)
- title.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- title.TextColor3 = Color3.new(1, 1, 1)
- title.Font = Enum.Font.GothamBold
- title.TextSize = 18
- title.Parent = frame
- -- TextBox
- local playerBox = Instance.new("TextBox")
- playerBox.PlaceholderText = "Enter Player Name"
- playerBox.Size = UDim2.new(1, -20, 0, 30)
- playerBox.Position = UDim2.new(0, 10, 0, 40)
- playerBox.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- playerBox.TextColor3 = Color3.new(1, 1, 1)
- playerBox.Font = Enum.Font.Gotham
- playerBox.TextSize = 16
- playerBox.ClearTextOnFocus = false
- playerBox.Parent = frame
- -- Button
- local tpButton = Instance.new("TextButton")
- tpButton.Text = "TP + Fling"
- tpButton.Size = UDim2.new(1, -20, 0, 30)
- tpButton.Position = UDim2.new(0, 10, 0, 80)
- tpButton.BackgroundColor3 = Color3.fromRGB(100, 50, 150)
- tpButton.TextColor3 = Color3.new(1, 1, 1)
- tpButton.Font = Enum.Font.GothamBold
- tpButton.TextSize = 16
- tpButton.Parent = frame
- -- Teleport and Fling Function
- tpButton.MouseButton1Click:Connect(function()
- local targetName = playerBox.Text
- local localPlr = game.Players.LocalPlayer
- local character = localPlr.Character
- local hrp = character and character:FindFirstChild("HumanoidRootPart")
- local humanoid = character and character:FindFirstChildOfClass("Humanoid")
- local targetPlayer = game.Players:FindFirstChild(targetName)
- if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local targetHRP = targetPlayer.Character.HumanoidRootPart
- if humanoid and hrp then
- -- Jump to enable fling motion
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- wait(0.1)
- -- TP to target
- hrp.CFrame = targetHRP.CFrame + Vector3.new(0, 2, 0)
- -- Fling velocity
- local bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.Velocity = Vector3.new(9999, 9999, 9999)
- bodyVelocity.MaxForce = Vector3.new(1e6, 1e6, 1e6)
- bodyVelocity.Parent = hrp
- game.Debris:AddItem(bodyVelocity, 0.2)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment