Advertisement
bobopopcornboy

grab server

Sep 26th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. event = Instance.new("RemoteEvent",script)
  2. event.Name = "event"
  3. start = true
  4. stPos = Vector2.new()
  5. point = Vector3.new()
  6. dis = 0
  7.  
  8. event.OnServerEvent:Connect(function(plyr,md,obj,hit,pos,cam,ss)
  9. print(plyr,md,obj,hit,pos,cam)
  10. if md == true then
  11. if start then
  12. start = false
  13. point = obj.Position - cam.Position
  14. stPos = pos
  15. dis = (pos - stPos).Magnitude
  16. obj.Anchored = true
  17. else
  18. local npos = pos - stPos
  19. npos = Vector2.new(npos.X,0-npos.Y)
  20. npos = npos / (ss * ((obj.Position - cam.Position).Magnitude * 10000 ))
  21. local Wpos = cam:VectorToWorldSpace(Vector3.new(npos.X,npos.Y,0))
  22.  
  23. obj.Position = obj.Position + Wpos
  24.  
  25. stPos = pos
  26. end
  27. else
  28. obj.Anchored = false
  29. start = true
  30. end
  31.  
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement