Advertisement
Guest User

Test 3

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