Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Title = Instance.new("TextLabel")
- local TextBox = Instance.new("TextBox")
- local FlingButton = Instance.new("TextButton")
- local StopFlingButton = Instance.new("TextButton")
- local Players = game:GetService("Players")
- -- Ensure the script is a LocalScript and parent GUI to Player's PlayerGui
- local player = Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- ScreenGui.Parent = playerGui
- -- Configure Frame
- Frame.Size = UDim2.new(0, 350, 0, 250)
- Frame.Position = UDim2.new(0.5, -175, 0.5, -125)
- Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) -- Dark gray background
- Frame.BorderSizePixel = 0
- Frame.Active = true
- Frame.Draggable = true
- Frame.Parent = ScreenGui
- -- Configure Title
- Title.Size = UDim2.new(1, 0, 0, 40)
- Title.Position = UDim2.new(0, 0, 0, 0)
- Title.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Slightly lighter gray
- Title.BorderSizePixel = 0
- Title.Text = "Fling GUI"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- Title.Font = Enum.Font.GothamBold
- Title.TextSize = 20
- Title.Parent = Frame
- -- Configure TextBox
- TextBox.Size = UDim2.new(0.9, 0, 0, 40)
- TextBox.Position = UDim2.new(0.05, 0, 0.2, 0)
- TextBox.PlaceholderText = "Enter part of username..."
- TextBox.Text = ""
- TextBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40) -- Darker gray
- TextBox.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- TextBox.Font = Enum.Font.Gotham
- TextBox.TextSize = 16
- TextBox.BorderSizePixel = 0
- TextBox.Parent = Frame
- -- Configure Fling Button
- FlingButton.Size = UDim2.new(0.9, 0, 0, 40)
- FlingButton.Position = UDim2.new(0.05, 0, 0.4, 0)
- FlingButton.Text = "Fling Target"
- FlingButton.BackgroundColor3 = Color3.fromRGB(70, 130, 180) -- Steel blue
- FlingButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- FlingButton.Font = Enum.Font.GothamBold
- FlingButton.TextSize = 16
- FlingButton.BorderSizePixel = 0
- FlingButton.Parent = Frame
- -- Configure Stop Fling Button
- StopFlingButton.Size = UDim2.new(0.9, 0, 0, 40)
- StopFlingButton.Position = UDim2.new(0.05, 0, 0.6, 0)
- StopFlingButton.Text = "Stop Fling"
- StopFlingButton.BackgroundColor3 = Color3.fromRGB(220, 20, 60) -- Crimson red
- StopFlingButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
- StopFlingButton.Font = Enum.Font.GothamBold
- StopFlingButton.TextSize = 16
- StopFlingButton.BorderSizePixel = 0
- StopFlingButton.Parent = Frame
- -- Add rounded corners to elements
- local function addUICorner(instance, radius)
- local uiCorner = Instance.new("UICorner")
- uiCorner.CornerRadius = UDim.new(0, radius)
- uiCorner.Parent = instance
- end
- addUICorner(Frame, 10)
- addUICorner(Title, 10)
- addUICorner(TextBox, 10)
- addUICorner(FlingButton, 10)
- addUICorner(StopFlingButton, 10)
- -- Function to find player by partial name
- local function findPlayerByName(partialName)
- for _, player in ipairs(Players:GetPlayers()) do
- if string.find(string.lower(player.Name), string.lower(partialName)) or
- string.find(string.lower(player.DisplayName), string.lower(partialName)) then
- return player
- end
- end
- return nil
- end
- -- Function to update the textbox with the full name
- local function updateTextBoxWithFullName(player)
- TextBox.Text = "@" .. player.DisplayName .. ", " .. player.Name
- end
- -- Variables to manage fling state
- local activeBodyVelocity = nil
- local flingConnection = nil
- -- Fling Button click event
- FlingButton.MouseButton1Click:Connect(function()
- local partialName = TextBox.Text
- if partialName == "" then
- warn("Please enter a username.")
- return
- end
- local targetPlayer = findPlayerByName(partialName)
- if not targetPlayer then
- warn("Player not found.")
- return
- end
- updateTextBoxWithFullName(targetPlayer)
- local targetCharacter = targetPlayer.Character
- local localCharacter = Players.LocalPlayer.Character
- if targetCharacter and localCharacter then
- local targetTorso = targetCharacter:FindFirstChild("HumanoidRootPart")
- if not targetTorso then
- warn("Target's HumanoidRootPart not found.")
- return
- end
- local localTorso = localCharacter:FindFirstChild("HumanoidRootPart")
- if targetTorso and localTorso then
- -- Attach local player to target's torso
- localTorso.CFrame = targetTorso.CFrame
- -- Apply extremely powerful and instant fling velocity to target
- local bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.Velocity = Vector3.new(0, 1e8, 0) -- Extremely high upward velocity for an even more powerful fling
- bodyVelocity.MaxForce = Vector3.new(1e6, 1e6, 1e6)
- bodyVelocity.Parent = targetTorso
- -- Store the BodyVelocity instance
- activeBodyVelocity = bodyVelocity
- -- Continuously update local player's position to stay inside the target's torso
- flingConnection = game:GetService("RunService").Heartbeat:Connect(function()
- if not targetTorso or not localTorso or not activeBodyVelocity then
- if flingConnection then
- flingConnection:Disconnect()
- flingConnection = nil
- end
- return
- end
- localTorso.CFrame = targetTorso.CFrame
- end)
- end
- end
- end)
- -- Stop Fling Button click event
- StopFlingButton.MouseButton1Click:Connect(function()
- if activeBodyVelocity then
- activeBodyVelocity:Destroy()
- activeBodyVelocity = nil
- end
- if flingConnection then
- flingConnection:Disconnect()
- flingConnection = nil
- end
- -- Reset player's health to respawn
- local character = player.Character
- if character then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid then
- humanoid.Health = 0
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement