Advertisement
lollolooloo

click drag gui roblox pastebin.com

May 4th, 2021 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. credit= sk8r
  2.  
  3. local player = game.Players.LocalPlayer
  4. local mouse = player:GetMouse()
  5. local down
  6. local mtarget
  7.  
  8. clickmoveon = true
  9.  
  10. function clickObj()
  11. if mouse.Target ~= nil then
  12. mtarget = mouse.Target
  13. down = true
  14. mouse.TargetFilter = mtarget
  15. end
  16. end
  17. mouse.Button1Down:connect(clickObj)
  18.  
  19. function mouseMove()
  20. if down and mtarget then
  21. local posX,posY,posZ = mouse.hit.X, mouse.hit.Y, mouse.hit.Z
  22. if clickmoveon then
  23. mtarget.Position = Vector3.new(posX,posY,posZ)
  24. end
  25. end
  26. end
  27.  
  28. mouse.Move:connect(mouseMove)
  29.  
  30. function mouseDown()
  31. down = false
  32. mouse.TargetFilter = nil
  33. end
  34.  
  35. mouse.Button1Up:connect(mouseDown)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement