Aeyao

swang

Jan 7th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local m = p:GetMouse()
  3. local on = false
  4. p.Character.Humanoid.PlatformStand = true
  5. m.Button1Down:connect(function()
  6.     on = true
  7. end)
  8.  
  9. m.Button1Up:connect(function()
  10.     on = false
  11. end)
  12.  
  13. local A1 = Instance.new("Attachment")
  14. local A2 = Instance.new("Attachment")
  15. local Rope = Instance.new("RopeConstraint")
  16.  
  17.  
  18. delay(0,function()
  19.     while wait() do
  20.         if on and m.Target then
  21.             A1.Parent = m.Target
  22.             A1.Position = -(m.Target.Position - m.Hit.p)
  23.             A2.Parent = p.Character.Torso
  24.            
  25.             Rope.Parent = p.Character.Torso
  26.             Rope.Attachment0 = A1
  27.             Rope.Attachment1 = A2
  28.             Rope.Length = (m.Hit.p -  p.Character.Torso.Position).magnitude
  29.             Rope.Visible = true
  30.             print((m.Target.Position -  p.Character.Torso.Position).magnitude)
  31.             repeat wait() until not on
  32.         else
  33.             A1.Parent = nil
  34.             A2.Parent = nil
  35.             Rope.Parent = nil
  36.             Rope.Attachment0 = nil
  37.             Rope.Attachment1 = nil
  38.             repeat wait() until on
  39.         end
  40.     end
  41. end)
Add Comment
Please, Sign In to add comment