Advertisement
Lasiv

Fling Things And People Script (Working!)

Mar 4th, 2023 (edited)
27,595
5
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | Gaming | 5 0
  1. -- THIS SCRIPT IS NOT TO FLING PEOPLE IN OTHER GAMES, THIS SCRIPT MADE FOR 1 GAME NAMED "Fling Things And People"
  2. local bodyvel_Name = "FlingVelocity"
  3. local userinputs = game:GetService("UserInputService")
  4. local workspace = game:GetService("Workspace")
  5. local runservice = game:GetService("RunService")
  6. local debris = game:GetService("Debris")
  7. local strength = 350 -- Сила Откида (Не выше 350 или античит будет мешать)
  8. workspace.ChildAdded:Connect(function(model)
  9.     if model.Name == "GrabParts" then
  10.         local part_to_impulse = model["GrabPart"]["WeldConstraint"].Part1
  11.  
  12.         if part_to_impulse then
  13.             print("Part found!")
  14.  
  15.             local inputObj
  16.             local velocityObj = Instance.new("BodyVelocity", part_to_impulse)
  17.  
  18.             model:GetPropertyChangedSignal("Parent"):Connect(function()
  19.                 if not model.Parent then
  20.                     if userinputs:GetLastInputType() == Enum.UserInputType.MouseButton2 then
  21.                         print("Launched!")
  22.                         velocityObj.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  23.                         velocityObj.Velocity = workspace.CurrentCamera.CFrame.lookVector * strength
  24.                         debris:AddItem(velocityObj, 1)
  25.                     elseif userinputs:GetLastInputType() == Enum.UserInputType.MouseButton1 then
  26.                         velocityObj:Destroy()
  27.                         print("Cancel Launch!")
  28.                     else
  29.                         velocityObj:Destroy()
  30.                         print("No two keys pressed!")
  31.                     end
  32.                 end
  33.             end)
  34.         end
  35.     end
  36. end)
  37.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement