Advertisement
EpicGamerSander1345

Untitled

Apr 17th, 2025
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3.  
  4. local localPlayer = Players.LocalPlayer
  5. local targetPlayer = nil
  6. local fling = false
  7. local targetHRP = nil
  8.  
  9. -- GUI setup
  10. local ScreenGui = Instance.new("ScreenGui")
  11. local Frame = Instance.new("Frame")
  12. local TextBox = Instance.new("TextBox")
  13. local FlingButton = Instance.new("TextButton")
  14. local StopButton = Instance.new("TextButton")
  15.  
  16. ScreenGui.Parent = game:GetService("CoreGui") -- Parent to CoreGui to keep it persistent
  17. Frame.Parent = ScreenGui
  18. Frame.Size = UDim2.new(0, 300, 0, 200)
  19. Frame.Position = UDim2.new(0.5, -150, 0.5, -100)
  20. Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  21. Frame.BorderSizePixel = 0
  22. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  23.  
  24. -- TextBox to enter player name
  25. TextBox.Parent = Frame
  26. TextBox.Size = UDim2.new(0, 200, 0, 30)
  27. TextBox.Position = UDim2.new(0.5, -100, 0.2, 0)
  28. TextBox.PlaceholderText = "Enter Player Name"
  29. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  30. TextBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  31.  
  32. -- Fling Button
  33. FlingButton.Parent = Frame
  34. FlingButton.Size = UDim2.new(0, 200, 0, 40)
  35. FlingButton.Position = UDim2.new(0.5, -100, 0.5, -20)
  36. FlingButton.Text = "Start Fling"
  37. FlingButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  38. FlingButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
  39.  
  40. -- Stop Button
  41. StopButton.Parent = Frame
  42. StopButton.Size = UDim2.new(0, 200, 0, 40)
  43. StopButton.Position = UDim2.new(0.5, -100, 0.7, 0)
  44. StopButton.Text = "Stop Fling"
  45. StopButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  46. StopButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  47.  
  48. -- Variables for dragging functionality
  49. local dragging = false
  50. local dragStartPos = nil
  51. local offset = nil
  52.  
  53. -- Function to handle dragging
  54. local function startDragging(input)
  55. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  56. dragging = true
  57. dragStartPos = input.Position
  58. offset = Frame.Position - UDim2.new(0, dragStartPos.X, 0, dragStartPos.Y)
  59. end
  60. end
  61.  
  62. local function onDrag(input)
  63. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  64. local delta = input.Position - dragStartPos
  65. Frame.Position = UDim2.new(0, offset.X + delta.X, 0, offset.Y + delta.Y)
  66. end
  67. end
  68.  
  69. local function stopDragging(input)
  70. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  71. dragging = false
  72. end
  73. end
  74.  
  75. -- Connect the drag functions to the GUI
  76. Frame.InputBegan:Connect(startDragging)
  77. Frame.InputChanged:Connect(onDrag)
  78. Frame.InputEnded:Connect(stopDragging)
  79.  
  80. -- Find player by partial name or display name
  81. local function findPlayerByPartialName(partial)
  82. partial = partial:lower()
  83. for _, player in ipairs(Players:GetPlayers()) do
  84. if player ~= localPlayer then
  85. local uname = player.Name:lower()
  86. local dname = player.DisplayName:lower()
  87. if uname:sub(1, #partial) == partial or dname:sub(1, #partial) == partial then
  88. return player
  89. end
  90. end
  91. end
  92. return nil
  93. end
  94.  
  95. -- Handle character respawn
  96. local function onCharacterAdded(character)
  97. local targetHRP = character:WaitForChild("HumanoidRootPart")
  98. end
  99.  
  100. -- Listen for respawns of the target player
  101. if targetPlayer then
  102. targetPlayer.CharacterAdded:Connect(onCharacterAdded)
  103. end
  104.  
  105. -- Fling logic
  106. RunService.Heartbeat:Connect(function()
  107. local myChar = localPlayer.Character
  108. local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
  109.  
  110. if myHRP then
  111. -- Only cancel velocity if you're being flung abnormally (not walking or jumping)
  112. if myHRP.Velocity.Magnitude > 200 then
  113. myHRP.Velocity = Vector3.zero
  114. end
  115.  
  116. if myHRP.RotVelocity.Magnitude > 200 then
  117. myHRP.RotVelocity = Vector3.zero
  118. end
  119. end
  120.  
  121. -- Fling logic
  122. if fling and targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("Head") and myHRP then
  123. local targetHead = targetPlayer.Character.Head
  124. local targetHRP = targetPlayer.Character.HumanoidRootPart
  125.  
  126. -- Teleport to target player's head (sit on their head)
  127. myHRP.CFrame = targetHead.CFrame * CFrame.new(0, 2, 0) -- Position the player slightly above the head
  128.  
  129. -- Apply much stronger force to fling the target
  130. local velocity = Vector3.new(math.random(-500, 500), math.random(500, 1000), math.random(-500, 500)) -- Stronger random fling direction and strength
  131. myHRP.Velocity = velocity
  132. myHRP.RotVelocity = Vector3.new(math.random(5000, 10000), math.random(5000, 10000), math.random(5000, 10000)) -- Stronger rotational force for extreme fling action
  133. end
  134. end)
  135.  
  136. -- Start Fling Button Click
  137. FlingButton.MouseButton1Click:Connect(function()
  138. local playerName = TextBox.Text
  139. if playerName and playerName ~= "" then
  140. local player = findPlayerByPartialName(playerName)
  141. if player then
  142. targetPlayer = player
  143. fling = true
  144. print("Flinging: " .. player.Name)
  145. else
  146. print("No player found starting with: " .. playerName)
  147. end
  148. else
  149. print("Please enter a player name.")
  150. end
  151. end)
  152.  
  153. -- Stop Fling Button Click
  154. StopButton.MouseButton1Click:Connect(function()
  155. fling = false
  156. targetPlayer = nil
  157. print("Fling stopped.")
  158. end)
  159.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement