Advertisement
Doomix

Cape

May 2nd, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. wait(2);
  2.  
  3. local ta1 = 5;
  4.  
  5. function Cape(player,color)
  6.  
  7. color = color or player.Torso.BrickColor;
  8.  
  9. if (player:FindFirstChild("Head") == nil) then return nil; end
  10.  
  11. local m = Instance.new("Model");
  12.  
  13. m.Name = "Cape_Yshi";
  14.  
  15. local neckpiece = Instance.new("Part",m);
  16.  
  17. neckpiece.formFactor = "Plate";
  18.  
  19. neckpiece.Size = Vector3.new(2,.4,1);
  20.  
  21. neckpiece.Name = "NeckPiece";
  22.  
  23. neckpiece.BrickColor = color;
  24.  
  25. neckpiece.CanCollide = false;
  26.  
  27. neckpiece.TopSurface = "Smooth";
  28.  
  29. neckpiece.BottomSurface = "Smooth";
  30.  
  31. local neckweld = Instance.new("Weld",neckpiece);
  32.  
  33. neckweld.Part0 = player.Head;
  34.  
  35. neckweld.Part1 = neckpiece;
  36.  
  37. neckweld.C0 = CFrame.new(0,-.5,0);
  38.  
  39. local seg1 = neckpiece:Clone();
  40.  
  41. seg1.Size = Vector3.new(3,.4,1);
  42.  
  43. seg1.Parent = m;
  44.  
  45. seg1.Name = "Segment_1";
  46.  
  47. local seg1w = Instance.new("Weld",seg1);
  48.  
  49. seg1w.Part0 = neckpiece;
  50.  
  51. seg1w.Part1 = seg1;
  52.  
  53. seg1w.C0 = CFrame.new(0,0,.45);
  54.  
  55. seg1w.C1 = CFrame.new(0,0,-.45)*CFrame.Angles(math.rad(-80),0,0);
  56.  
  57. local seg2 = seg1:Clone();
  58.  
  59. seg2.Parent = m;
  60.  
  61. seg2.Name = "Segment_2";
  62.  
  63. local seg2w = Instance.new("Weld",seg2);
  64.  
  65. seg2w.Part0 = seg1;
  66.  
  67. seg2w.Part1 = seg2;
  68.  
  69. seg2w.C0 = CFrame.new(0,0,.45);
  70.  
  71. seg2w.C1 = CFrame.new(0,0,-.45)*CFrame.Angles(math.rad(-5),0,0);
  72.  
  73. m.Parent = player;
  74.  
  75. local seg3 = seg2:Clone();
  76.  
  77. seg3.Parent = m;
  78.  
  79. seg3.Name = "Segment_3";
  80.  
  81. local seg3w = Instance.new("Weld",seg3);
  82.  
  83. seg3w.Part0 = seg2;
  84.  
  85. seg3w.Part1 = seg3;
  86.  
  87. seg3w.C0 = CFrame.new(0,0,.45);
  88.  
  89. seg3w.C1 = CFrame.new(0,0,-.45)*CFrame.Angles(math.rad(-2),0,0);
  90.  
  91. local seg4 = seg3:Clone();
  92.  
  93. seg4.Name = "Segment_4";
  94.  
  95. seg4.Parent = m;
  96.  
  97. local seg4w = Instance.new("Weld",seg4);
  98.  
  99. seg4w.Part0 = seg3;
  100.  
  101. seg4w.Part1 = seg4;
  102.  
  103. seg4w.C0 = CFrame.new(0,0,.45);
  104.  
  105. seg4w.C1 = CFrame.new(0,0,-.45);
  106.  
  107. return m;
  108.  
  109. end
  110.  
  111. function Flex(cape,vals)
  112.  
  113. for i,v in pairs(vals) do
  114.  
  115. if(i ~= 1) then
  116.  
  117. cape:GetChildren()[i].Weld.C1 = CFrame.new(0,0,-.45)*CFrame.Angles(math.rad(vals[i-1]),0,0);
  118.  
  119. end
  120.  
  121. end
  122.  
  123. end
  124.  
  125. local char = game.Players.LocalPlayer.Character;
  126.  
  127. local cape = Cape(char);
  128.  
  129. local lastfrstrad = -60;
  130.  
  131. for i=0, math.huge do
  132.  
  133. local frstrad = -60;
  134.  
  135. ta = ta1 * char.Torso.Velocity.magnitude/16 + 1 * (math.random()+.5);
  136.  
  137. if(ta>10) then
  138.  
  139. ta = math.random(90,100)/10;
  140.  
  141. end
  142.  
  143. frstrad = frstrad + (char.Torso.Velocity.magnitude) + math.sin(i)*3*ta;
  144.  
  145. if(frstrad > 65) then
  146.  
  147. frstrad = 65;
  148.  
  149. elseif (char.Torso.Velocity.magnitude < 5) then
  150.  
  151. frstrad = -80;
  152.  
  153. end
  154.  
  155. if(char.Humanoid:HasCustomStatus("Flying"))then
  156.  
  157. frstrad = -80;
  158.  
  159. ta = 15;
  160.  
  161. end
  162.  
  163. frstrad = (frstrad+lastfrstrad)/2;
  164.  
  165. lastfrstrad = frstrad;
  166.  
  167. Flex(cape,{frstrad,math.sin(i+20)*-1*ta,math.sin(i+20)*2*ta,math.sin(i+20)*ta,math.sin(i+20)*-1*ta});
  168.  
  169. wait(.05);
  170.  
  171. end
  172.  
  173. print 'Hello world!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement