Advertisement
PC55654

flingFE

Sep 17th, 2024
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.66 KB | Source Code | 0 0
  1. local Targets = {"All"} -- "All", "Target Name", "arian_was_here"
  2. local Players = game:GetService("Players")
  3. local Player = Players.LocalPlayer
  4. local AllBool = false
  5.  
  6. -- Create a ScreenGui for the player count
  7. local playerGui = Player:WaitForChild("PlayerGui")
  8. local screenGui = Instance.new("ScreenGui")
  9. screenGui.Parent = playerGui
  10.  
  11. local playerCountLabel = Instance.new("TextLabel")
  12. playerCountLabel.Size = UDim2.new(0, 200, 0, 50)
  13. playerCountLabel.Position = UDim2.new(0.5, -100, 0.1, -25) -- Top center of the screen
  14. playerCountLabel.Text = ""
  15. playerCountLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  16. playerCountLabel.TextColor3 = Color3.new(0, 0, 0)
  17. playerCountLabel.Parent = screenGui
  18.  
  19. -- Update the label with the number of players left to fling
  20. local function updatePlayerCountLabel(count)
  21.     playerCountLabel.Text = "Players Left: " .. tostring(count)
  22. end
  23.  
  24. local GetPlayer = function(Name)
  25.     Name = Name:lower()
  26.     if Name == "all" or Name == "others" then
  27.         AllBool = true
  28.         return
  29.     elseif Name == "random" then
  30.         local GetPlayers = Players:GetPlayers()
  31.         if table.find(GetPlayers, Player) then table.remove(GetPlayers, table.find(GetPlayers, Player)) end
  32.         return GetPlayers[math.random(#GetPlayers)]
  33.     elseif Name ~= "random" and Name ~= "all" and Name ~= "others" then
  34.         for _, x in next, Players:GetPlayers() do
  35.             if x ~= Player then
  36.                 if x.Name:lower():match("^" .. Name) then
  37.                     return x
  38.                 elseif x.DisplayName:lower():match("^" .. Name) then
  39.                     return x
  40.                 end
  41.             end
  42.         end
  43.     else
  44.         return
  45.     end
  46. end
  47.  
  48. local Message = function(_Title, _Text, Time)
  49.     game:GetService("StarterGui"):SetCore("SendNotification", {Title = _Title, Text = _Text, Duration = Time})
  50. end
  51. local SkidFling = function(TargetPlayer)
  52.     local Character = Player.Character
  53.     local Humanoid = Character and Character:FindFirstChildOfClass("Humanoid")
  54.     local RootPart = Humanoid and Humanoid.RootPart
  55.  
  56.     local TCharacter = TargetPlayer.Character
  57.     local THumanoid
  58.     local TRootPart
  59.     local THead
  60.     local Accessory
  61.     local Handle
  62.  
  63.     if TCharacter:FindFirstChildOfClass("Humanoid") then
  64.         THumanoid = TCharacter:FindFirstChildOfClass("Humanoid")
  65.     end
  66.     if THumanoid and THumanoid.RootPart then
  67.         TRootPart = THumanoid.RootPart
  68.     end
  69.     if TCharacter:FindFirstChild("Head") then
  70.         THead = TCharacter.Head
  71.     end
  72.     if TCharacter:FindFirstChildOfClass("Accessory") then
  73.         Accessory = TCharacter:FindFirstChildOfClass("Accessory")
  74.     end
  75.     if Accessoy and Accessory:FindFirstChild("Handle") then
  76.         Handle = Accessory.Handle
  77.     end
  78.  
  79.     if Character and Humanoid and RootPart then
  80.         if RootPart.Velocity.Magnitude < 50 then
  81.             getgenv().OldPos = RootPart.CFrame
  82.         end
  83.         if THumanoid and THumanoid.Sit and not AllBool then
  84.             return Message("Error Occurred", "Targeting is sitting", 5) -- u can remove dis part if u want lol
  85.         end
  86.         if THead then
  87.             workspace.CurrentCamera.CameraSubject = THead
  88.         elseif not THead and Handle then
  89.             workspace.CurrentCamera.CameraSubject = Handle
  90.         elseif THumanoid and TRootPart then
  91.             workspace.CurrentCamera.CameraSubject = THumanoid
  92.         end
  93.         if not TCharacter:FindFirstChildWhichIsA("BasePart") then
  94.             return
  95.         end
  96.        
  97.         local FPos = function(BasePart, Pos, Ang)
  98.             RootPart.CFrame = CFrame.new(BasePart.Position) * Pos * Ang
  99.             Character:SetPrimaryPartCFrame(CFrame.new(BasePart.Position) * Pos * Ang)
  100.             RootPart.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
  101.             RootPart.RotVelocity = Vector3.new(9e8, 9e8, 9e8)
  102.         end
  103.        
  104.         local SFBasePart = function(BasePart)
  105.             local TimeToWait = 2
  106.             local Time = tick()
  107.             local Angle = 0
  108.  
  109.             repeat
  110.                 if RootPart and THumanoid then
  111.                     if BasePart.Velocity.Magnitude < 50 then
  112.                         Angle = Angle + 100
  113.  
  114.                         FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle),0 ,0))
  115.                         task.wait()
  116.  
  117.                         FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  118.                         task.wait()
  119.  
  120.                         FPos(BasePart, CFrame.new(2.25, 1.5, -2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  121.                         task.wait()
  122.  
  123.                         FPos(BasePart, CFrame.new(-2.25, -1.5, 2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
  124.                         task.wait()
  125.  
  126.                         FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
  127.                         task.wait()
  128.  
  129.                         FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
  130.                         task.wait()
  131.                     else
  132.                         FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
  133.                         task.wait()
  134.  
  135.                         FPos(BasePart, CFrame.new(0, -1.5, -THumanoid.WalkSpeed), CFrame.Angles(0, 0, 0))
  136.                         task.wait()
  137.  
  138.                         FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
  139.                         task.wait()
  140.                        
  141.                         FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
  142.                         task.wait()
  143.  
  144.                         FPos(BasePart, CFrame.new(0, -1.5, -TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(0, 0, 0))
  145.                         task.wait()
  146.  
  147.                         FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
  148.                         task.wait()
  149.  
  150.                         FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(math.rad(90), 0, 0))
  151.                         task.wait()
  152.  
  153.                         FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
  154.                         task.wait()
  155.  
  156.                         FPos(BasePart, CFrame.new(0, -1.5 ,0), CFrame.Angles(math.rad(-90), 0, 0))
  157.                         task.wait()
  158.  
  159.                         FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
  160.                         task.wait()
  161.                     end
  162.                 else
  163.                     break
  164.                 end
  165.             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
  166.         end
  167.        
  168.         workspace.FallenPartsDestroyHeight = 0/0
  169.        
  170.         local BV = Instance.new("BodyVelocity")
  171.         BV.Name = "EpixVel"
  172.         BV.Parent = RootPart
  173.         BV.Velocity = Vector3.new(9e8, 9e8, 9e8)
  174.         BV.MaxForce = Vector3.new(1/0, 1/0, 1/0)
  175.        
  176.         Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
  177.        
  178.         if TRootPart and THead then
  179.             if (TRootPart.CFrame.p - THead.CFrame.p).Magnitude > 5 then
  180.                 SFBasePart(THead)
  181.             else
  182.                 SFBasePart(TRootPart)
  183.             end
  184.         elseif TRootPart and not THead then
  185.             SFBasePart(TRootPart)
  186.         elseif not TRootPart and THead then
  187.             SFBasePart(THead)
  188.         elseif not TRootPart and not THead and Accessory and Handle then
  189.             SFBasePart(Handle)
  190.         else
  191.             return Message("Error Occurred", "Target is missing everything", 5)
  192.         end
  193.        
  194.         BV:Destroy()
  195.         Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
  196.         workspace.CurrentCamera.CameraSubject = Humanoid
  197.        
  198.         repeat
  199.             RootPart.CFrame = getgenv().OldPos * CFrame.new(0, .5, 0)
  200.             Character:SetPrimaryPartCFrame(getgenv().OldPos * CFrame.new(0, .5, 0))
  201.             Humanoid:ChangeState("GettingUp")
  202.             table.foreach(Character:GetChildren(), function(_, x)
  203.                 if x:IsA("BasePart") then
  204.                     x.Velocity, x.RotVelocity = Vector3.new(), Vector3.new()
  205.                 end
  206.             end)
  207.             task.wait()
  208.         until (RootPart.Position - getgenv().OldPos.p).Magnitude < 25
  209.         workspace.FallenPartsDestroyHeight = getgenv().FPDH
  210.     else
  211.         return Message("Error Occurred", "Random error", 5)
  212.     end
  213. end
  214.  
  215. if not Welcome then Message("Script by AnthonyIsntHere", "Enjoy!", 5) end
  216. getgenv().Welcome = true
  217. if Targets[1] then for _,x in next, Targets do GetPlayer(x) end else return end
  218.  
  219. if AllBool then
  220.     for _,x in next, Players:GetPlayers() do
  221.         SkidFling(x)
  222.     end
  223. end
  224.  
  225. for _,x in next, Targets do
  226.     if GetPlayer(x) and GetPlayer(x) ~= Player then
  227.         if GetPlayer(x).UserId ~= 1414978355 then
  228.             local TPlayer = GetPlayer(x)
  229.             if TPlayer then
  230.                 SkidFling(TPlayer)
  231.             end
  232.         else
  233.             Message("Error Occurred", "This user is whitelisted! (Owner)", 5)
  234.         end
  235.     elseif not GetPlayer(x) and not AllBool then
  236.         Message("Error Occurred", "Username Invalid", 5)
  237.     end
  238. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement