Totek2007

Ezio

Jul 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.70 KB | None | 0 0
  1.  
  2. script.Parent = nil
  3.  
  4. local plr = game.Players.LocalPlayer
  5. local char = plr.Character
  6. local hum = char.Humanoid
  7. local tar = char["Torso"]
  8.  
  9. local par = char
  10.  
  11. local capename = "sCape"
  12. if par:FindFirstChild(capename) then par[capename]:Destroy() end
  13.  
  14. local Parts = {}
  15. local capeLength = 4 -- studs
  16. local partAm = 25
  17. local startWidth = 2.2
  18. local endWidth = 3.4
  19. local thickness = .1
  20. local ups = 30 -- updates per second
  21. local clr = BrickColor.new("Really black")
  22. local Hair = true
  23. local suit = true
  24. local phys = true
  25.  
  26.  
  27. local widthCh = (endWidth-startWidth)/partAm
  28. local zSiz = capeLength/partAm
  29.  
  30.  
  31. local Model = Instance.new("Model",par)
  32. Model.Name = capename
  33.  
  34. function weld(p0,p1,c0,c1)
  35. local w = Instance.new("Weld",Model)
  36. w.Part0 = p0
  37. w.Part1 = p1
  38. w.C0 = c0 or CFrame.new()
  39. w.C1 = c1 or CFrame.new()
  40. return w
  41. end
  42.  
  43. function invcol(c)
  44. c = c.Color
  45. return BrickColor.new(Color3.new(1-c.b,1-c.g,1-c.r))
  46. end
  47.  
  48. local part = Instance.new("Part",Model)
  49. Instance.new("BlockMesh",part)
  50. part.Material = "SmoothPlastic"
  51. part.FormFactor = "Custom"
  52. part.BrickColor = clr
  53. part.FormFactor = "Custom"
  54. part.Size = Vector3.new(.2,.2,.2)
  55. part.TopSurface = "SmoothNoOutlines"
  56. part.BottomSurface = "SmoothNoOutlines"
  57. part.LeftSurface = "SmoothNoOutlines"
  58. part.RightSurface = "SmoothNoOutlines"
  59. part.Parent = Model
  60. part:BreakJoints()
  61. part.Reflectance = 0
  62. part.CanCollide = false
  63. part.Locked = true
  64. part.Mesh.Scale = Vector3.new(startWidth,thickness,1+(thickness))/.2
  65. weld(tar,part,CFrame.new(0,.989,0))
  66.  
  67. local tor,la,ra,ll,rl,hd = char:FindFirstChild("Torso"),char:FindFirstChild("Left Arm"),char:FindFirstChild("Right Arm"),
  68. char:FindFirstChild("Left Leg"), char:FindFirstChild("Right Leg"), char:FindFirstChild("Head")
  69.  
  70. pcall(function() la.Transparency = 0 end)
  71. pcall(function() ra.Transparency = 0 end)
  72. pcall(function() ll.Transparency = 0 end)
  73. pcall(function() rl.Transparency = 0 end)
  74. pcall(function() hd.Transparency = 0 end)
  75. pcall(function() tar.Transparency = 0 end)
  76.  
  77. --[[if not Hair or not suit then
  78. pcall(function() hd.face.Face = "Front" end)
  79. end]]
  80.  
  81. if Hair then
  82. for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then pcall(function() v.Handle.Transparency = 1 end) end end
  83. local Hair = part:Clone()
  84. Hair.Parent = Model
  85. Hair.Mesh:Destroy()
  86. local m = Instance.new("SpecialMesh",Hair)
  87. m.MeshId = "http://www.roblox.com/asset/?id=62246019"
  88. --m.TextureId = "http://www.roblox.com/asset/?id=91740209"
  89. m.Scale = Vector3.new(1,1,1)
  90. m.VertexColor = Vector3.new(clr.Color.r,clr.Color.g,clr.Color.b)
  91. weld(hd,Hair,CFrame.new(-0.06,0.3,0.2))
  92. end
  93. if suit then
  94. part.Mesh.Scale = Vector3.new(2,thickness,1+thickness)/.2
  95. pcall(function() la.Transparency = 1 end)
  96. pcall(function() ra.Transparency = 1 end)
  97. pcall(function() ll.Transparency = 1 end)
  98. pcall(function() rl.Transparency = 1 end)
  99. pcall(function() tar.Transparency = 1 end)
  100. if hd and Hair then
  101. --pcall(function() hd.face.Face = "Bottom" end)
  102. local bbg = Instance.new("BillboardGui",hd2)
  103. bbg.Size = UDim2.new(2,0,1,0)
  104. bbg.SizeOffset = Vector2.new(0,1.2)
  105. local tl = Instance.new("TextLabel",bbg)
  106. tl.BackgroundTransparency = 1
  107. tl.Size = UDim2.new(1,0,.4,0)
  108. tl.TextScaled = true
  109. tl.Text = char.Name--"Assassin"
  110. tl.TextTransparency = .9
  111. tl.TextColor3 = Color3.new(1,0,0)
  112. end
  113. local p = part:Clone()
  114. p.BrickColor = BrickColor.new("Silver")
  115. p.Reflectance = .4
  116. p.Parent = Model
  117. p.Mesh.Scale = Vector3.new(1.2,.3,.1)/.2
  118. weld(ra,p,CFrame.new(0,1,-.5) * CFrame.Angles(math.rad(20),0,math.rad(5)))
  119. p = p:Clone()
  120. p.Parent = Model
  121. weld(ra,p,CFrame.new(0,1,.5) * CFrame.Angles(math.rad(-20),0,math.rad(5)))
  122.  
  123. p = p:Clone()
  124. p.Parent = Model
  125. p.Mesh.Scale = Vector3.new(1.2,.4,.1)/.2
  126. weld(ra,p,CFrame.new(-.02,1.15,-.275) * CFrame.Angles(math.rad(80),math.rad(5),math.rad(2.5)))
  127. p = p:Clone()
  128. p.Parent = Model
  129. weld(ra,p,CFrame.new(-.02,1.15,.275) * CFrame.Angles(math.rad(-80),math.rad(-5),math.rad(2.5)))
  130.  
  131. p = p:Clone()
  132. p.Parent = Model
  133. p.Mesh.Scale = Vector3.new(1.2,.2,.1)/.2
  134. weld(ra,p,CFrame.new(-.03,1.185,0) * CFrame.Angles(math.rad(90),math.rad(5),math.rad(0)))
  135. p = p:Clone()
  136. p.Parent = Model
  137. p.Mesh.Scale = Vector3.new(.1,.2,1)/.2
  138. weld(ra,p,CFrame.new(.55,.975,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(5)))
  139. p = p:Clone()
  140. p.Parent = Model
  141. p.Mesh.Scale = Vector3.new(.1,.2,.9)/.2
  142. weld(ra,p,CFrame.new(.54,1.095,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(5)))
  143. p = p:Clone()
  144. p.Parent = Model
  145. p.Mesh.Scale = Vector3.new(.1,.2,1)/.2
  146. weld(ra,p,CFrame.new(-.34,1.025,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(5)))
  147.  
  148. local p2 = p:Clone()
  149. p2.BrickColor = clr
  150. p2.Parent = Model
  151. p2.Mesh.Scale = Vector3.new(.1,1.35,.2)/.2
  152. weld(ra,p2,CFrame.new(.5,-.35,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  153. p2 = p2:Clone()
  154. p2.Parent = Model
  155. p2.Mesh.Scale = Vector3.new(.1,.5,.2)/.2
  156. weld(ra,p2,CFrame.new(.499,0.055,-.145) * CFrame.Angles(math.rad(30),math.rad(0),math.rad(0)))
  157. p2 = p2:Clone()
  158. p2.Parent = Model
  159. p2.Mesh.Scale = Vector3.new(.1,.5,.2)/.2
  160. weld(ra,p2,CFrame.new(.499,0.055,.145) * CFrame.Angles(math.rad(-30),math.rad(0),math.rad(0)))
  161. p2 = p2:Clone()
  162. p2.Parent = Model
  163. p2.Mesh.Scale = Vector3.new(.1,.905,.2)/.2
  164. weld(ra,p2,CFrame.new(.498,-.569,-.255) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  165. p2 = p2:Clone()
  166. p2.Parent = Model
  167. p2.Mesh.Scale = Vector3.new(.1,.905,.2)/.2
  168. weld(ra,p2,CFrame.new(.498,-.569,.255) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  169. p2 = p2:Clone()
  170. p2.Parent = Model
  171. p2.Mesh.Scale = Vector3.new(1.05,.1,.199)/.2
  172. weld(ra,p2,CFrame.new(.0249,-1,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  173. p2 = p2:Clone()
  174. p2.Parent = Model
  175. p2.Mesh.Scale = Vector3.new(1.05,.1,.199)/.2
  176. weld(ra,p2,CFrame.new(.0235,-1,.255) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  177. p2 = p2:Clone()
  178. p2.Parent = Model
  179. p2.Mesh.Scale = Vector3.new(1.05,.1,.199)/.2
  180. weld(ra,p2,CFrame.new(.0235,-1,-.255) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  181. p2 = p2:Clone()
  182. p2.Parent = Model
  183. p2.Mesh.Scale = Vector3.new(.7,.7,1.1)/.2
  184. weld(ra,p2,CFrame.new(0,-.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  185.  
  186. p = p:Clone()
  187. p.Parent = Model
  188. p.Mesh.Scale = Vector3.new(1.05,1.05,1.05)/.2
  189. weld(ra,p,CFrame.new(0,-.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  190.  
  191.  
  192. p = part:Clone()
  193. p.Parent = Model
  194. p.Mesh.Scale = Vector3.new(1.01,1.01,1.01)/.2
  195. weld(ra,p,CFrame.new(0,0.5,0))
  196. local p3 = part:Clone()
  197. p3.Parent = Model
  198. p3.Mesh:Destroy()
  199. Instance.new("SpecialMesh",p3).MeshType = Enum.MeshType.Wedge
  200. p3.Mesh.Scale = Vector3.new(1.05,1.05,1.21)/.2
  201. weld(la,p3,CFrame.new(-.1,.5,0) * CFrame.Angles(math.rad(180),math.rad(90),math.rad(0)))
  202. p = p:Clone()
  203. p.Parent = Model
  204. p.Mesh:Destroy()
  205. p.BrickColor = BrickColor.new("Brick yellow")
  206. Instance.new("SpecialMesh",p).MeshType = Enum.MeshType.Brick
  207. p.Mesh.Scale = Vector3.new(1,2,1)/.2
  208. weld(la,p,CFrame.new(0,0,0))
  209. p = p:Clone()
  210. p.Parent = Model
  211. p.BrickColor = invcol(clr)
  212. p.Mesh.Scale = Vector3.new(1.05,1.5,1.04)/.2
  213. weld(la,p,CFrame.new(0,.25,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  214.  
  215. p = part:Clone()
  216. p.BrickColor = invcol(clr)
  217. p.Parent = Model
  218. p.Mesh.Scale = Vector3.new(2.1,.2,1.099)/.2
  219. weld(tar,p,CFrame.new(0,-.91,0))
  220. p = p:Clone()
  221. p.Parent = Model
  222. p.Mesh.Scale = Vector3.new(.2,2.41,1.099)/.2
  223. weld(tar,p,CFrame.new(0,0.05,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(40)))
  224. p = p:Clone()
  225. p.Parent = Model
  226. p.Mesh.Scale = Vector3.new(.1,.1,1.099)/.2
  227. weld(tar,p,CFrame.new(-.8,.95,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  228.  
  229. p = part:Clone()
  230. p.Parent = Model
  231. p.Mesh.Scale = Vector3.new(2.003,2.003,1.003)/.2
  232. weld(tar,p,CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  233.  
  234. p = p:Clone()
  235. p.Parent = Model
  236. p.Mesh.Scale = Vector3.new(1.003,2.003,1.003)/.2
  237. weld(ll,p,CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  238. p = p:Clone()
  239. p.Parent = Model
  240. p.Mesh.Scale = Vector3.new(1.003,2.003,1.003)/.2
  241. weld(rl,p,CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  242. end
  243.  
  244. local Main = part:Clone()
  245. Main.Parent = Model
  246. Main.Mesh.Scale = Vector3.new(startWidth/.2,thickness/Main.Size.Y,zSiz/Main.Size.X)
  247. Main:BreakJoints()
  248.  
  249. local M1 = Instance.new("Motor6D")
  250. M1.MaxVelocity = 0
  251. M1.Part0 = tar
  252. M1.Part1 = Main
  253. M1.C0 = CFrame.new(0,1,.5) * CFrame.Angles(0,math.pi/2,0)
  254. M1.C1 = CFrame.new(0,0,-zSiz/2) * CFrame.Angles(0,math.pi/2,0)
  255. M1.Parent = Model
  256. --[[
  257. local p2 = Main:Clone()
  258. p2.Parent = Model
  259. p2.Size = Vector3.new(.2,p2.Size.X,.2)
  260. p2.Mesh:Destroy()
  261. Instance.new("CylinderMesh",p2).Scale = Vector3.new(1,.99,1)
  262. local W = Instance.new("Weld",Model)
  263. W.Part0 = Main
  264. W.Part1 = p2
  265. W.C0 = CFrame.new(0,0,-zSiz/2) * CFrame.Angles(0,0,math.pi/2)]]
  266. local last = Main
  267.  
  268. for i=1,partAm-1 do
  269. local p = Main:Clone()
  270. p.Parent = Model
  271. local sz = widthCh*i/.2
  272. p.Mesh.Scale = Vector3.new(p.Mesh.Scale.X + sz,p.Mesh.Scale.Y,p.Mesh.Scale.Z)
  273. p:BreakJoints()
  274. local M = M1:Clone()
  275. M.C0 = CFrame.new(0,0,zSiz/2) * CFrame.Angles(0,math.pi/2,0)
  276. M.Part0 = last
  277. M.Part1 = p
  278. M.Parent = Model
  279.  
  280. table.insert(Parts,{p = M, l = 0, an = 0})
  281. last = p
  282. end
  283.  
  284. function Lerp(start,goal,alpha)
  285. return start* (1-alpha) + goal*alpha
  286. end
  287.  
  288. local mode = "idle"
  289.  
  290. function getForwardSpeed()
  291. local FwVec = tar.Velocity * tar.CFrame.lookVector
  292. FwVec = Vector3.new(FwVec.X > -0.05 and FwVec.X or 0, 0, FwVec.Z > -0.05 and FwVec.Z or 0)
  293. return FwVec.X + FwVec.Z
  294. end
  295.  
  296. function getBackwardSpeed()
  297. local BwVec = tar.Velocity * tar.CFrame.lookVector
  298. BwVec = Vector3.new(BwVec.X < 0.05 and BwVec.X or 0, 0, BwVec.Z < 0.05 and BwVec.Z or 0)
  299. return BwVec.X + BwVec.Z
  300. end
  301.  
  302. function getMainAlpha()
  303. return .2
  304. end
  305.  
  306. function getAngle()
  307. if mode == "run" then return math.max(0.1,math.min(2-(getForwardSpeed()/16)^0.50,1)) end
  308. if mode == "jump" then return 1.55 end
  309. if mode == "fall" then return -1.2 end
  310. if mode == "moonwalk" then return 1.50 end
  311. return 1.55
  312. end
  313.  
  314. function getWaveAm()
  315. if mode == "run" then return 1 end
  316. if mode == "jump" then return 3 end
  317. if mode == "fall" then return 1 end
  318. if mode == "moonwalk" then return 1 end
  319. return .1
  320. end
  321.  
  322. function getWaveSize()
  323. if mode == "run" then return .1 end
  324. if mode == "jump" then return .1 end
  325. if mode == "fall" then return .1 end
  326. if mode == "moonwalk" then return .01 end
  327. return math.rad(1)
  328. end
  329.  
  330. while Model ~= nil and Model.Parent ~= nil and tar ~= nil and not closeall do
  331. local verVel = tar.CFrame:vectorToObjectSpace(tar.Velocity).Y
  332. if verVel < -5 then
  333. mode = "fall"
  334. elseif verVel > 5 then
  335. mode = "jump"
  336. else
  337. if getForwardSpeed() > 0 or getBackwardSpeed() > 0 then
  338. if getForwardSpeed() > char.Humanoid.WalkSpeed/2 then
  339. mode = "run"
  340. else
  341. mode = "moonwalk"
  342. end
  343. else
  344. mode = "idle"
  345. end
  346. end
  347. local wave = (math.abs((tick() % (1/getWaveAm()))-(1/getWaveAm()/2)) - (1/getWaveAm()/2)) *(getWaveAm()*getWaveSize())
  348.  
  349. M1.CurrentAngle = Lerp(M1.CurrentAngle,getAngle(),.2)+wave -- .2 = 50
  350.  
  351. local an = M1.CurrentAngle
  352. local blkd = false
  353. local blkan = 0
  354. for i,v in pairs(Parts) do
  355.  
  356. local ang = Lerp((v.an-an),0,0.4 + (0.05*(partAm/10))) -- .7 = 50
  357. v.p.CurrentAngle = ang
  358.  
  359. if capeLength > 4 and phys then
  360. local part0 = v.p.Part0
  361. local part1 = v.p.Part1
  362. local x = part0.Mesh.Scale.X*.2
  363. local lblkd = false
  364. local am = 3
  365. for a=1,am do
  366. local pos0 = (part0.CFrame * CFrame.new(-x/2+x/am*a,0,0)).p + Vector3.new(0,thickness,0)
  367. local pos1= (part1.CFrame * CFrame.new(-x/2+x/am*a,0,0)).p - Vector3.new(0,thickness,0)
  368. local hit,ray = workspace:FindPartOnRayWithIgnoreList(Ray.new(pos0,(pos1-pos0).unit*(pos0-pos1).magnitude),{Model,workspace.CurrentCamera,char})
  369. if hit and hit.CanCollide then
  370. lblkd = true
  371. break
  372. end
  373. end
  374. if blkd and not lblkd then
  375. ang = 1.55--blkan
  376. elseif lblkd then
  377. if not blkd then
  378. ang = -an
  379. blkan = an
  380. end
  381. end
  382. blkd = lblkd
  383.  
  384. v.p.CurrentAngle = ang
  385. end
  386.  
  387. v.an = an
  388. an = an + ang
  389. end
  390.  
  391.  
  392. wait(1/ups)
  393. if not Model:IsDescendantOf(workspace) then break end
  394. end
Add Comment
Please, Sign In to add comment