Advertisement
nicholasXPG

Untitled

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