Advertisement
mathmasterphil

Part Grabber

Mar 4th, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. p=game.Players.LocalPlayer
  2. t=p.Character.Torso
  3. m=p:GetMouse()
  4. m.Button1Down:connect(function()
  5. if m.Target.Name == 'Base' then return end
  6. pcall(function()
  7. local part=m.Target
  8. part.Anchored = true
  9. local sl=Instance.new('SelectionPartLasso',part)
  10. sl.Humanoid=p.Character.Humanoid
  11. sl.Part=part
  12. sl.Color=BrickColor.Random()
  13. local int=math.random(0,360)
  14. local s=0
  15. local u=10
  16. local dir=true
  17. game:service'RunService'.Stepped:connect(function()
  18. part.CFrame=t.CFrame*CFrame.Angles(0,math.rad(int+s),0)*CFrame.new(0,0,-u)
  19. s=s+1
  20. if dir==true then
  21. u=u+.5
  22. elseif dir==false then
  23. u=u-.5
  24. end
  25. if u==12 or u==8 then
  26. dir=not dir
  27. end
  28. if s==360 then s=0 end
  29. end)
  30. end)
  31. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement