Advertisement
icy-desudesu

dslocal

Aug 18th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer
  2.  
  3. Player = game.Players.LocalPlayer
  4. char = Player.Character
  5. h = char.Humanoid
  6. tool = script.Parent
  7. local user
  8. local range = 10
  9. grab = false
  10.  
  11. animTrack1 = nil
  12. damselAnimTrack = nil
  13.  
  14. tool.Equipped:connect(function(mouse)
  15. mouse.Button1Down:connect(function()
  16. if grab == true then return end
  17. local ray = Ray.new(tool.Handle.CFrame.p, (mouse.hit.p - tool.Handle.CFrame.p).unit*range)
  18. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  19. local humanoid = hit and hit.Parent:FindFirstChild("Humanoid")
  20. if humanoid and humanoid ~= char.Humanoid then
  21. grab = true
  22. local damselChar = humanoid.Parent
  23. humanoid.PlatformStand = true
  24. local newHandle = tool.Handle:Clone()
  25. newHandle.Parent = char
  26. local newWeld = Instance.new("ManualWeld", char)
  27. newWeld.Part0 = newHandle
  28. newWeld.Part1 = char.Torso
  29. local weld = Instance.new("ManualWeld", char)
  30. weld.Part0 = newHandle
  31. weld.Part1 = damselChar.HumanoidRootPart
  32. weld.C0 = CFrame.new(1.6, .3, -1.8)
  33. animTrack1 = h:LoadAnimation(tool.damsel1)
  34. animTrack1:Play()
  35. damselAnimTrack = humanoid:LoadAnimation(tool.damsel2)
  36. damselAnimTrack:Play()
  37. tool.Unequipped:connect(function()
  38. humanoid.PlatformStand = false
  39. grab = false
  40. animTrack1:Stop()
  41. damselAnimTrack:Stop()
  42. weld:Destroy()
  43. newHandle:Destroy()
  44. newWeld:Destroy()
  45. end)
  46. end
  47. end)
  48. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement