Mryeetmemes

How to make a Tool Fling system

Aug 20th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. --All scripts to fling people--
  2.  
  3. --Setup Things--
  4. --Open Explorer and click the plus button on StarterGui
  5. --Put a tool and open properties
  6. --Make sure that CanBeDropped and RequiresHandle is false
  7. --Add a Script
  8. --Add a LocalScript
  9. --Add RemoteEvent
  10. --Do not give the 3 things any names or It will break the script
  11. --So anyway, Here are the scripts
  12.  
  13. --Scripts--
  14.  
  15. --Put this into Script--
  16. script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,victim)
  17.     local PushForce = Instance.new("BodyVelocity")
  18.     PushForce.Name = "PushForce"
  19.     PushForce.MaxForce = Vector3.new(10000000,10000000,10000000)
  20.     PushForce.Velocity = (-victim.HumanoidRootPart.CFrame.lookVector) * 100
  21.     PushForce.Parent = victim.HumanoidRootPart
  22.    
  23.     wait(0.25)
  24.     PushForce:Destroy()
  25. end)
  26.  
  27. --Put his into LocalScript--
  28. local mouse = game.Players.LocalPlayer:GetMouse()
  29.  
  30. script.Parent.Activated:Connect(function()
  31.     if mouse.Target then
  32.         local model = mouse.Target:FindFirstAncestorOfClass("Model")
  33.         if model then
  34.             if model:FindFirstChild("Humanoid") then
  35.                 script.Parent.RemoteEvent:FireServer(model)
  36.             end
  37.         end
  38.     end
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment