Advertisement
bobopopcornboy

grab local

Sep 26th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. plyr = game.Players.LocalPlayer
  2. mouse = plyr:GetMouse()
  3. event = workspace.GrabServer.event
  4. md = false
  5. tar = nil
  6. point = Vector3.new()
  7.  
  8. mouse.Button1Down:Connect(function()
  9. tar = mouse.Target
  10. md = true
  11. point = mouse.Hit.Position - tar.Position
  12. event:FireServer(true,tar,mouse.Hit.Position,Vector2.new(mouse.X,mouse.Y), workspace.CurrentCamera.CFrame)
  13. end)
  14. mouse.Button1Up:Connect(function()
  15. md = false
  16. event:FireServer(false,tar)
  17. end)
  18.  
  19. while wait() do
  20. if md then
  21. event:FireServer(true,tar,mouse.Hit.Position,Vector2.new(mouse.X,mouse.Y), workspace.CurrentCamera.CFrame,workspace.CurrentCamera.ViewportSize)
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement