Advertisement
Roblox_Editer_Man

Untitled

May 20th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game.Players.PlayerAdded:connect(function(player)
  2. player.CharacterAdded:connect(function(chr)
  3. repeat wait() until player and player.Character and player.Character:FindFirstChild("Humanoid")
  4. if player.Character:FindFirstChild("Torso") then
  5. torso = player.Character.Torso
  6. else
  7. torso = player.Character.UpperTorso
  8. end
  9. local p = Instance.new("Part", torso.Parent)
  10. p.Name = "Cape"
  11. p.Anchored = false
  12. p.CanCollide = false
  13. p.TopSurface = 0
  14. p.BottomSurface = 0
  15. p.BrickColor = BrickColor.new("Bright yellow")
  16. p.FormFactor = "Custom"
  17. p.Size = Vector3.new(0.2,0.2,0.2)
  18. local msh = Instance.new("BlockMesh", p)
  19. msh.Scale = Vector3.new(9,17.5,0.5)
  20. local motor = Instance.new("Motor", p)
  21. motor.Part0 = p
  22. motor.Part1 = torso
  23. motor.MaxVelocity = 0.01
  24. motor.C0 = CFrame.new(0,1.75,0) * CFrame.Angles(0,math.rad(90),0)
  25. motor.C1 = CFrame.new(0,1,0.45) * CFrame.Angles(0,math.rad(90),0)
  26. local wave = false
  27. repeat wait(1/44)
  28. local ang = 0.1
  29. local oldmag = torso.Velocity.magnitude
  30. local mv = 0.002
  31. if wave then
  32. ang = ang + ((torso.Velocity.magnitude/10) * 0.05) + 0.05
  33. wave = false
  34. else
  35. wave = true
  36. end
  37. ang = ang + math.min(torso.Velocity.magnitude/11, 0.5)
  38. motor.MaxVelocity = math.min((torso.Velocity.magnitude/111), 0.04) + mv
  39. motor.DesiredAngle = -ang
  40. if motor.CurrentAngle < -0.2 and motor.DesiredAngle > -0.2 then
  41. motor.MaxVelocity = 0.04
  42. end
  43. repeat wait() until motor.CurrentAngle == motor.DesiredAngle or math.abs(torso.Velocity.magnitude - oldmag) >= (torso.Velocity.magnitude/10) + 1
  44. if torso.Velocity.magnitude < 0.1 then
  45. wait(0.1)
  46. end
  47. until not p or p.Parent ~= torso.Parent
  48. end)
  49. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement