MaxproGlitcher

Gui Fling Test V1

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