Alex_great

BH Cape

Jun 11th, 2022 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. local player = game:GetService("Players")
  2.  
  3. local lplr = player.LocalPlayer
  4.  
  5. if lplr.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  6.  
  7. if lplr.Character:FindFirstChild("Torso") then
  8.  
  9. torso = lplr.Character.Torso
  10.  
  11. else
  12.  
  13. torso = lplr.Character.UpperTorso
  14.  
  15. end
  16.  
  17. local CapeP = Instance.new("Part", torso.Parent)
  18.  
  19. CapeP.Name = "Cape"
  20.  
  21. CapeP.Anchored = false
  22.  
  23. CapeP.CanCollide = false
  24.  
  25. CapeP.TopSurface = 0
  26.  
  27. CapeP.BottomSurface = 0
  28.  
  29. CapeP.Color = Color3.fromRGB(34,34,34)
  30.  
  31. CapeP.FormFactor = "Custom"
  32.  
  33. CapeP.Size = Vector3.new(0.2,0.2,0.2)
  34.  
  35. local decal = Instance.new("Decal", CapeP)
  36.  
  37. decal.Texture = "rbxthumb://type=Asset&id=9879986954&w=150&h=150"
  38.  
  39. decal.Face = "Back"
  40.  
  41. local msh = Instance.new("BlockMesh", CapeP)
  42.  
  43. msh.Scale = Vector3.new(9,17.5,0.5)
  44.  
  45. local motor = Instance.new("Motor", CapeP)
  46.  
  47. motor.Part0 = CapeP
  48.  
  49. motor.Part1 = torso
  50.  
  51. motor.MaxVelocity = 0.01
  52.  
  53. motor.C0 = CFrame.new(0,1.75,0) * CFrame.Angles(0,math.rad(90),0)
  54.  
  55. motor.C1 = CFrame.new(0,1,0.45) * CFrame.Angles(0,math.rad(90),0)
  56.  
  57. local wave = false
  58.  
  59. repeat wait(1/44)
  60.  
  61. decal.Transparency = torso.Transparency
  62.  
  63. local ang = 0.1
  64.  
  65. local oldmag = torso.Velocity.magnitude
  66.  
  67. local mv = 0.002
  68.  
  69. if wave then
  70.  
  71. ang = ang + ((torso.Velocity.magnitude/10) * 0.05) + 0.05
  72.  
  73. wave = false
  74.  
  75. else
  76.  
  77. wave = true
  78.  
  79. end
  80.  
  81. ang = ang + math.min(torso.Velocity.magnitude/11, 0.5)
  82.  
  83. motor.MaxVelocity = math.min((torso.Velocity.magnitude/111), 0.04) + mv
  84.  
  85. motor.DesiredAngle = -ang
  86.  
  87. if motor.CurrentAngle < -0.2 and motor.DesiredAngle > -0.2 then
  88.  
  89. motor.MaxVelocity = 0.04
  90.  
  91. end
  92.  
  93. repeat wait() until motor.CurrentAngle == motor.DesiredAngle or math.abs(torso.Velocity.magnitude - oldmag) >= (torso.Velocity.magnitude/10) + 1
  94.  
  95. if torso.Velocity.magnitude < 0.1 then
  96.  
  97. wait(0.1)
  98.  
  99. end
  100.  
  101. until not CapeP or CapeP.Parent ~= torso.Parent
  102.  
  103. end
  104.  
  105. end)
Add Comment
Please, Sign In to add comment