Advertisement
princeofheaven

Untitled

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