HowToRoblox

DetectBoulderThrow

Aug 1st, 2021 (edited)
968
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local re = game.ReplicatedStorage:WaitForChild("BoulderRE")
  2.  
  3.  
  4. local mouse = game.Players.LocalPlayer:GetMouse()
  5.  
  6.  
  7. local uis = game:GetService("UserInputService")
  8.  
  9.  
  10.  
  11. uis.InputBegan:Connect(function(inp, processed)
  12.  
  13.     if processed then return end
  14.  
  15.  
  16.     if inp.KeyCode == Enum.KeyCode.H then
  17.  
  18.  
  19.         re:FireServer()
  20.     end
  21. end)
  22.  
  23.  
  24. re.OnClientEvent:Connect(function(boulder)
  25.    
  26.    
  27.     boulder.BodyVelocity.Velocity = mouse.Hit.LookVector * 200
  28.    
  29.     boulder.BodyAngularVelocity.AngularVelocity = mouse.Hit.LookVector * 50
  30. end)
RAW Paste Data