Advertisement
Guest User

fling player script

a guest
Nov 17th, 2024
5,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.05 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Player = Players.LocalPlayer
  3.  
  4. local ScreenGui = Instance.new("ScreenGui")
  5. local Frame = Instance.new("Frame")
  6. local TextBox = Instance.new("TextBox")
  7. local TextButton = Instance.new("TextButton")
  8. local CloseButton = Instance.new("TextButton") -- Close button
  9.  
  10. ScreenGui.Parent = Player:WaitForChild("PlayerGui")
  11. ScreenGui.ResetOnSpawn = false
  12.  
  13. Frame.Parent = ScreenGui
  14. Frame.BackgroundColor3 = Color3.fromRGB(33, 33, 33)
  15. Frame.Position = UDim2.new(0.5, -100, 0.5, -50)
  16. Frame.Size = UDim2.new(0, 200, 0, 100)
  17. Frame.Active = true
  18. Frame.Draggable = true
  19.  
  20. TextBox.Parent = Frame
  21. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  22. TextBox.Position = UDim2.new(0.1, 0, 0.2, 0)
  23. TextBox.Size = UDim2.new(0.8, 0, 0.2, 0)
  24. TextBox.Font = Enum.Font.SourceSans
  25. TextBox.PlaceholderText = "Enter username"
  26. TextBox.Text = ""
  27. TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  28. TextBox.TextSize = 14
  29.  
  30. TextButton.Parent = Frame
  31. TextButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  32. TextButton.Position = UDim2.new(0.1, 0, 0.5, 0)
  33. TextButton.Size = UDim2.new(0.8, 0, 0.4, 0)
  34. TextButton.Font = Enum.Font.SourceSans
  35. TextButton.Text = "FLING!"
  36. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  37. TextButton.TextSize = 20
  38.  
  39. -- Close button properties
  40. CloseButton.Parent = Frame
  41. CloseButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  42. CloseButton.Position = UDim2.new(0.9, 0, 0, 0)
  43. CloseButton.Size = UDim2.new(0, 20, 0, 20)
  44. CloseButton.Font = Enum.Font.SourceSans
  45. CloseButton.Text = "X"
  46. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  47. CloseButton.TextSize = 14
  48.  
  49. local function GetPlayer(Name)
  50. Name = Name:lower()
  51. for _, x in next, Players:GetPlayers() do
  52. if x ~= Player then
  53. if x.Name:lower():match("^" .. Name) or x.DisplayName:lower():match("^" .. Name) then
  54. return x
  55. end
  56. end
  57. end
  58. return nil
  59. end
  60.  
  61. local function Message(_Title, _Text, Time)
  62. game:GetService("StarterGui"):SetCore("SendNotification", {Title = _Title, Text = _Text, Duration = Time})
  63. end
  64.  
  65. local function SkidFling(TargetPlayer)
  66. local Character = Player.Character
  67. local Humanoid = Character and Character:FindFirstChildOfClass("Humanoid")
  68. local RootPart = Humanoid and Humanoid.RootPart
  69.  
  70. local TCharacter = TargetPlayer.Character
  71. local THumanoid = TCharacter and TCharacter:FindFirstChildOfClass("Humanoid")
  72. local TRootPart = THumanoid and THumanoid.RootPart
  73. local THead = TCharacter and TCharacter:FindFirstChild("Head")
  74. local Accessory = TCharacter and TCharacter:FindFirstChildOfClass("Accessory")
  75. local Handle = Accessory and Accessory:FindFirstChild("Handle")
  76.  
  77. if Character and Humanoid and RootPart then
  78. if RootPart.Velocity.Magnitude < 50 then
  79. getgenv().OldPos = RootPart.CFrame
  80. end
  81. if THumanoid and THumanoid.Sit then
  82. return Message("Error Occurred", "Target is sitting", 5)
  83. end
  84. if THead then
  85. workspace.CurrentCamera.CameraSubject = THead
  86. elseif Handle then
  87. workspace.CurrentCamera.CameraSubject = Handle
  88. else
  89. workspace.CurrentCamera.CameraSubject = THumanoid
  90. end
  91. if not TCharacter:FindFirstChildWhichIsA("BasePart") then
  92. return
  93. end
  94.  
  95. local function FPos(BasePart, Pos, Ang)
  96. RootPart.CFrame = CFrame.new(BasePart.Position) * Pos * Ang
  97. Character:SetPrimaryPartCFrame(CFrame.new(BasePart.Position) * Pos * Ang)
  98. RootPart.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
  99. RootPart.RotVelocity = Vector3.new(9e8, 9e8, 9e8)
  100. end
  101.  
  102. local function SFBasePart(BasePart)
  103. local TimeToWait = 2
  104. local Time = tick()
  105. local Angle = 0
  106.  
  107. repeat
  108. if RootPart and THumanoid then
  109. if BasePart.Velocity.Magnitude < 50 then
  110. Angle = Angle + 100
  111.  
  112. FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle),0 ,0))
  113. task.wait()
  114.  
  115. FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  116. task.wait()
  117.  
  118. FPos(BasePart, CFrame.new(2.25, 1.5, -2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  119. task.wait()
  120.  
  121. FPos(BasePart, CFrame.new(-2.25, -1.5, 2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  122. task.wait()
  123.  
  124. FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
  125. task.wait()
  126.  
  127. FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
  128. task.wait()
  129. else
  130. FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
  131. task.wait()
  132.  
  133. FPos(BasePart, CFrame.new(0, -1.5, -THumanoid.WalkSpeed), CFrame.Angles(0, 0, 0))
  134. task.wait()
  135.  
  136. FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
  137. task.wait()
  138.  
  139. FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
  140. task.wait()
  141.  
  142. FPos(BasePart, CFrame.new(0, -1.5, -TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(0, 0, 0))
  143. task.wait()
  144.  
  145. FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
  146. task.wait()
  147.  
  148. FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(math.rad(90), 0, 0))
  149. task.wait()
  150.  
  151. FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
  152. task.wait()
  153.  
  154. FPos(BasePart, CFrame.new(0, -1.5 ,0), CFrame.Angles(math.rad(-90), 0, 0))
  155. task.wait()
  156.  
  157. FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
  158. task.wait()
  159. end
  160. else
  161. break
  162. end
  163. until BasePart.Velocity.Magnitude > 500 or BasePart.Parent ~= TargetPlayer.Character or TargetPlayer.Parent ~= Players or not TargetPlayer.Character == TCharacter or THumanoid.Sit or Humanoid.Health <= 0 or tick() > Time + TimeToWait
  164. end
  165.  
  166. workspace.FallenPartsDestroyHeight = 0/0
  167.  
  168. local BV = Instance.new("BodyVelocity")
  169. BV.Name = "EpixVel"
  170. BV.Parent = RootPart
  171. BV.Velocity = Vector3.new(9e8, 9e8, 9e8)
  172. BV.MaxForce = Vector3.new(1/0, 1/0, 1/0)
  173.  
  174. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
  175.  
  176. if TRootPart and THead then
  177. if (TRootPart.CFrame.p - THead.CFrame.p).Magnitude > 5 then
  178. SFBasePart(THead)
  179. else
  180. SFBasePart(TRootPart)
  181. end
  182. elseif TRootPart and not THead then
  183. SFBasePart(TRootPart)
  184. elseif not TRootPart and THead then
  185. SFBasePart(THead)
  186. elseif not TRootPart and not THead and Accessory and Handle then
  187. SFBasePart(Handle)
  188. end
  189.  
  190. BV:Destroy()
  191. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
  192. workspace.CurrentCamera.CameraSubject = Humanoid
  193.  
  194. repeat
  195. RootPart.CFrame = getgenv().OldPos * CFrame.new(0, .5, 0)
  196. Character:SetPrimaryPartCFrame(getgenv().OldPos * CFrame.new(0, .5, 0))
  197. Humanoid:ChangeState("GettingUp")
  198. table.foreach(Character:GetChildren(), function(_, x)
  199. if x:IsA("BasePart") then
  200. x.Velocity, x.RotVelocity = Vector3.new(), Vector3.new()
  201. end
  202. end)
  203. task.wait()
  204. until (RootPart.Position - getgenv().OldPos.p).Magnitude < 25
  205. workspace.FallenPartsDestroyHeight = getgenv().FPDH
  206. else
  207. return Message("Error Occurred", "Random error", 5)
  208. end
  209. end
  210.  
  211. TextButton.MouseButton1Click:Connect(function()
  212. local targetName = TextBox.Text
  213. local targetPlayer = GetPlayer(targetName)
  214.  
  215. if targetPlayer then
  216. SkidFling(targetPlayer)
  217. else
  218. Message("Error Occurred", "Invalid username", 5)
  219. end
  220. end)
  221.  
  222. -- Close button functionality
  223. CloseButton.MouseButton1Click:Connect(function()
  224. ScreenGui.Enabled = false
  225. end)
Tags: fling
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement