Advertisement
SDr0YT

Roblox Fling Script by kcz1_o

Jan 27th, 2024 (edited)
25,780
2
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.57 KB | Gaming | 2 0
  1. local Config = {
  2.     Bind = Enum.KeyCode.Z,
  3.     Select_Color = Color3.fromRGB(0, 255, 0),
  4.    
  5.     Prediction_Enable = true
  6. }
  7.  
  8.  
  9.  
  10. local UserInputService = game:GetService("UserInputService")
  11. local RunService = game:GetService("RunService")
  12. local Players = game:GetService("Players")
  13.  
  14. local Player = Players.LocalPlayer
  15. local Char = Player.Character
  16. local Mouse = Player:GetMouse()
  17.  
  18. local Root = Char:WaitForChild("HumanoidRootPart")
  19. local Humanoid = Char:WaitForChild("Humanoid")
  20.  
  21. local SelectionBox = Instance.new("SelectionBox", script)
  22. SelectionBox.Color3 = Config.Select_Color
  23. SelectionBox.LineThickness = 0.02
  24.  
  25. local A_1 = false
  26. local A_2 = false
  27.  
  28. UserInputService.InputBegan:Connect(function(Input, GPE)
  29.     if GPE then return end
  30.    
  31.     if Input.KeyCode == Config.Bind then
  32.         if A_2 == false then
  33.             A_1 = not A_1
  34.  
  35.             SelectionBox.Adornee = nil
  36.         end
  37.     end
  38. end)
  39.  
  40. Mouse.Move:Connect(function()
  41.     if A_1 == true then
  42.         if Mouse.Target then
  43.             if Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
  44.                 local Character = Mouse.Target.Parent
  45.                
  46.                 SelectionBox.Adornee = Character
  47.             else
  48.                 SelectionBox.Adornee = nil
  49.             end
  50.         else
  51.             SelectionBox.Adornee = nil
  52.         end
  53.     end
  54. end)
  55.  
  56. Mouse.Button1Down:Connect(function()
  57.     if A_1 == true and A_2 == false then
  58.         local Character = SelectionBox.Adornee
  59.        
  60.         if Character ~= nil then
  61.             A_2 = true
  62.            
  63.             local BodyThrust = Instance.new('BodyGyro', Char.HumanoidRootPart)
  64.             BodyThrust.CFrame = CFrame.Angles(math.huge, math.huge, math.huge)
  65.            
  66.             local LastPos = Char.HumanoidRootPart.CFrame
  67.            
  68.             while Char.HumanoidRootPart and Character.HumanoidRootPart do
  69.                 RunService.Heartbeat:Wait()
  70.                
  71.                 if Character.HumanoidRootPart.Velocity.Magnitude <= 100 then
  72.                     if Config.Prediction_Enable then
  73.                         local Direction = Character.HumanoidRootPart.Position + (Character.Humanoid.MoveDirection * Character.Humanoid.WalkSpeed)/2 + (Vector3.new(0, Character.HumanoidRootPart.Velocity.Y/10, 0))
  74.                        
  75.                         Char.HumanoidRootPart.CFrame = (CFrame.new(Direction)) * Root.CFrame.Rotation
  76.                     else
  77.                         Char.HumanoidRootPart.CFrame = Character.HumanoidRootPart.CFrame * Root.CFrame.Rotation
  78.                     end
  79.                    
  80.                     Char.HumanoidRootPart.Velocity = Vector3.new()
  81.                 else
  82.                     break;
  83.                 end
  84.             end
  85.            
  86.             BodyThrust:Destroy()
  87.            
  88.             Char.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new()
  89.             Char.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new()
  90.            
  91.             Char.HumanoidRootPart.CFrame = LastPos
  92.            
  93.             Char.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
  94.         end
  95.        
  96.         A_2 = false
  97.     end
  98. end)
Advertisement
Comments
  • SDr0YT
    1 year
    # text 0.12 KB | 0 0
    1. Press Z to activate, and then point at the player and click the mouse to fling him (the script is not supported for phones)
  • SDr0YT
    1 year
    # text 0.06 KB | 0 0
    1. Version 1.1 - prediction update ( there may be bugs due to ping )
Add Comment
Please, Sign In to add comment
Advertisement