Advertisement
Dark_EccentricYT

Untitled

Dec 30th, 2016
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.83 KB | None | 0 0
  1. plr=game:service'Players'.LocalPlayer
  2. ch=plr.Character
  3. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  4. m,mouse=plr:GetMouse(),plr:GetMouse()
  5. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  6. combo=false
  7. if ch:findFirstChild("Inficio") then
  8. ch.Inficio:Destroy()
  9. end
  10.  
  11. local tube=int("Model",ch)
  12. tube.Name='Inficio'
  13.  
  14. getSound=function(id)
  15. local s=int("Sound",ch.Head)
  16. s.Volume=1
  17. s.SoundId=id
  18. return s
  19. end
  20.  
  21. hitS=getSound('http://www.roblox.com/asset?id=123252378')
  22. swingS=getSound('http://www.roblox.com/asset?id=154965929')
  23. sheathS=getSound('http://www.roblox.com/asset?id=130785407')
  24. drawS=getSound('http://www.roblox.com/asset?id=130785405')
  25.  
  26. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)--recommend to use this with my weld. use this function only with arm lockers.
  27. p0.Position = p1.Position
  28. local w = Instance.new('Motor',par or p0)
  29. w.Part0 = p1
  30. w.Part1 = p0
  31. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  32. w.MaxVelocity = .1
  33. return w
  34. end
  35.  
  36.  
  37. weld=function(p0,p1,c0)--basic weld function
  38. local w=Instance.new("Weld",p0)
  39. w.Part0=p0
  40. w.Part1=p1
  41. w.C0=c0
  42. return w
  43. end
  44.  
  45.  
  46. cp=function(parent,color,size,anchored,cancollide)--creates a part. automagically returns the part so you can edit it manually.
  47. local newp=Instance.new("Part",parent)
  48. newp.Material = "SmoothPlastic"
  49. newp.TopSurface=10
  50. newp.BottomSurface=10
  51. newp.LeftSurface=10
  52. newp.RightSurface=10
  53. newp.FrontSurface=10
  54. newp.BackSurface=10
  55. newp.FormFactor="Custom"
  56. newp.BrickColor=BrickColor.new(color)
  57. newp.Size=size
  58. newp.Anchored=anchored
  59. newp.CanCollide=cancollide
  60. newp:BreakJoints()
  61. return newp
  62. end
  63. Tween = function(Weld, Stop, Step,a)
  64. ypcall(function()
  65. local func = function()
  66. local Start = Weld.C1
  67. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  68. local Stop = Stop
  69. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  70.  
  71. for i = 0, 1, Step or .1 do
  72. Weld.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  73. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  74. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  75. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  76. (Z1 * (1 - i)) + (Z2 * i) )
  77. wait()
  78. end
  79.  
  80. Weld.C1 = Stop
  81. end
  82.  
  83. if a then coroutine.wrap(func)() else func() end
  84. end)
  85. end
  86.  
  87. Tween2 = function(Weld, Stop, Step,a)
  88. ypcall(function()--- TweenWeld function (not made by me)
  89. local func = function()
  90. local Start = Weld.CFrame
  91. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  92. local Stop = Stop
  93. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  94.  
  95. for i = 0, 1, Step or .1 do
  96. Weld.CFrame = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  97. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  98. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  99. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  100. (Z1 * (1 - i)) + (Z2 * i) )
  101. wait()
  102. end
  103.  
  104. Weld.CFrame = Stop
  105. end
  106.  
  107. if a then coroutine.wrap(func)() else func() end
  108. end)
  109. end
  110.  
  111.  
  112. cyl=function(prt)
  113. local c=int("CylinderMesh",prt)
  114. return c
  115. end
  116.  
  117. blo=function(prt)
  118. local c=int("BlockMesh",prt)
  119. return c
  120. end
  121.  
  122.  
  123. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  124. rabr.Position = torso.Position
  125. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  126. w = Instance.new("Weld",tube)
  127. w.Part0,w.Part1 = ch['Right Arm'],rabr
  128. w.C1 = CFrame.new(0,-.5,0)
  129.  
  130. labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  131. labr.Position = torso.Position
  132. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  133. ww = Instance.new("Weld",tube)
  134. ww.Part0,ww.Part1 = ch['Left Arm'],labr
  135. ww.C1 = CFrame.new(0,-.5,0)
  136.  
  137. mh=cp(tube,"Brown",Vector3.new(1,1,1))
  138. mw=weld(ch['Right Arm'],mh,CFrame.new(0,-1,0)*ang(mr(-90),0,0))
  139. local b=blo(mh)
  140. b.Scale=Vector3.new(0.23,1,0.23)
  141.  
  142. local hp=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  143. weld(mh,hp,CFrame.new(0,-0.6,0))
  144. local b=blo(hp)
  145. b.Scale=Vector3.new(0.28,0.28,0.28)
  146.  
  147. local hpa=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  148. weld(mh,hpa,CFrame.new(0,0.57,0))
  149. local b=blo(hpa)
  150. b.Scale=Vector3.new(0.28,0.15,0.7)
  151.  
  152. local blade=cp(tube,"Light stone grey",Vector3.new(1,2.6,1))
  153. blade.Material='SmoothPlastic'
  154. blade.TopSurface='SmoothNoOutlines'
  155. weld(hpa,blade,CFrame.new(0,1.4,0))
  156. local b=blo(blade)
  157. b.Scale=Vector3.new(0.18,1,0.53)
  158.  
  159. local tip=cp(tube,"Light stone grey",Vector3.new(1,0.3,1))
  160. tip.Material='SmoothPlastic'
  161. tip.TopSurface='SmoothNoOutlines'
  162. tip.Name='tip'
  163. weld(blade,tip,CFrame.new(0,1.45,0))
  164. local we=int("SpecialMesh",tip)
  165. we.MeshType='Wedge'
  166. we.Scale=Vector3.new(0.18,1,0.53)
  167. tip.BottomSurface='SmoothNoOutlines'
  168.  
  169. local blade2=cp(tube,"Bright yellow",Vector3.new(1,2.6,1))
  170. blade2.Material='SmoothPlastic'
  171. blade2.TopSurface='SmoothNoOutlines'
  172. weld(blade,blade2,CFrame.new(0,0,0))
  173. local b=blo(blade2)
  174. b.Scale=Vector3.new(0.19,1,0.2515)
  175.  
  176. local ring=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  177. ring.Material='SmoothPlastic'
  178. weld(blade,ring,CFrame.new(0,-0.5,0))
  179. local b=blo(ring)
  180. b.Scale=Vector3.new(0.2,0.1,0.54)
  181.  
  182. local ring=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  183. ring.Material='SmoothPlastic'
  184. weld(blade,ring,CFrame.new(0,-0.7,0))
  185. local b=blo(ring)
  186. b.Scale=Vector3.new(0.2,0.1,0.54)
  187.  
  188. local ring=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  189. ring.Material='SmoothPlastic'
  190. weld(blade,ring,CFrame.new(0,-1,0))
  191. local b=blo(ring)
  192. b.Scale=Vector3.new(0.2,0.2,0.54)
  193.  
  194. local tip2=cp(tube,"Bright yellow",Vector3.new(1,0.3,1))
  195. tip2.BottomSurface='SmoothNoOutlines'
  196. tip2.TopSurface='SmoothNoOutlines'
  197. tip2.Material='SmoothPlastic'
  198. weld(blade2,tip2,CFrame.new(0,1.35,0))
  199. local we=int("SpecialMesh",tip2)
  200. we.MeshType='Wedge'
  201. we.Scale=Vector3.new(0.19,0.5,0.2515)
  202.  
  203.  
  204.  
  205.  
  206. local hpa=cp(tube,"Bright yellow",Vector3.new(1,1,1))
  207. weld(mh,hpa,CFrame.new(0,0.67,0))
  208. local b=blo(hpa)
  209. b.Scale=Vector3.new(0.2,0.1,0.54)
  210.  
  211. local sht=cp(tube,"Brown",Vector3.new(2.4,0.7,0.3))
  212. weld(torso,sht,CFrame.new(0,0,0.7)*ang(0,0,mr(45)))
  213. sht.Transparency=1
  214. deb=false
  215. sheathed=false
  216.  
  217.  
  218. sheath=function()
  219. if sheathed==false then
  220. Spawn(function()
  221. Tween(lw,cfn())
  222. for i=1,10 do
  223. wait()
  224. sht.Transparency=sht.Transparency-0.1
  225. end
  226. end)
  227. Tween(rw,cfn()*ang(mr(-160),mr(-30),0))
  228. sheathS:Play()
  229. mw:Destroy()
  230. ypcall(function()
  231. mw:Destroy()
  232. mw=nil
  233.  
  234. end)
  235. mw=weld(sht,mh,CFrame.new(1.85,0,0)*ang(mr(90),0,mr(90)))
  236. Tween(rw,cfn())
  237. Tween(lw,cfn())
  238. sheathed=true
  239. rabr:Destroy()
  240. labr:Destroy()
  241. end
  242. end
  243.  
  244. unsheath=function()
  245. if sheathed==true then
  246. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  247. rabr.Position = torso.Position
  248. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  249. w = Instance.new("Weld",tube)
  250. w.Part0,w.Part1 = ch['Right Arm'],rabr
  251. w.C1 = CFrame.new(0,-.5,0)
  252.  
  253. labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  254. labr.Position = torso.Position
  255. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  256. ww = Instance.new("Weld",tube)
  257. ww.Part0,ww.Part1 = ch['Left Arm'],labr
  258. ww.C1 = CFrame.new(0,-.5,0)
  259. Spawn(function()
  260. Tween(lw,cfn())
  261. for i=1,10 do
  262. wait()
  263. sht.Transparency=sht.Transparency+0.1
  264. end
  265. end)
  266. Tween(rw,cfn()*ang(mr(-160),mr(-30),0))
  267. drawS:Play()
  268. mw:Destroy()
  269. ypcall(function()
  270. mw:Destroy()
  271. mw=nil
  272.  
  273. end)
  274. mw=weld(ch['Right Arm'],mh,CFrame.new(0,-1,0)*ang(mr(-90),0,0))
  275. Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)))
  276. Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)))
  277. sheathed=false
  278. end
  279. end
  280.  
  281.  
  282. attacks={
  283. [1]={function()
  284. deb=true
  285. combo=true
  286. Spawn(function()
  287. Tween(lw,cfn()*ang(mr(-40),mr(5),mr(20)),0.1)
  288. end)
  289. Tween(rw,cfn()*ang(mr(-115),mr(-15),mr(-60)),0.1)
  290. wait(0.1)
  291. swingS:Play()
  292. Spawn(function()
  293. Tween(lw,cfn()*ang(mr(35),mr(5),mr(20)),0.2)
  294. end)
  295. Tween(rw,cfn()*ang(mr(30),mr(-15),mr(-60)),0.2)
  296. deb=false
  297. combo=false
  298. wait(3)
  299. if combo==false then Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)),0.4) Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.4) end
  300. end};
  301. [2]={function()
  302. deb=true
  303. combo=true
  304. Spawn(function()
  305. Tween(rj,cfn()*ang(0,mr(-90),0))
  306. end)
  307. Tween(rw,cfn()*ang(mr(0),mr(0),mr(-90)),0.1)
  308.  
  309. Tween(rw,cfn()*ang(mr(80),mr(0),mr(-90)),0.25)
  310. swingS:Play()
  311. Tween(rj,cfn()*ang(0,mr(0),0),0.2)
  312. deb=false
  313. combo=false
  314. wait(3)
  315. if combo==false then Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)),0.4) Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.4) end
  316. end};
  317. [3]={function()
  318. deb=true
  319. combo=true
  320. Tween(rw,cfn()*ang(mr(0),mr(0),mr(-90)),0.1)
  321. torso.Anchored=true
  322. swingS:Play()
  323. Spawn(function()
  324. wait(0.3)
  325. swingS:Play()
  326. end)
  327. for i=1,13 do
  328. wait()
  329. torso.CFrame=torso.CFrame*ang(0,0.5,0)
  330. end
  331. torso.Anchored=false
  332. deb=false
  333. combo=false
  334. wait(3)
  335. if combo==false then Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)),0.4) Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.4) end
  336. end};
  337. [4]={function()
  338. deb=true
  339. combo=true
  340. Spawn(function()
  341. Tween(lw,cfn()*ang(mr(-40),mr(5),mr(20)),0.1)
  342. end)
  343. Tween(rw,cfn()*ang(mr(-115),mr(15),mr(60)),0.1)
  344. wait(0.1)
  345. swingS:Play()
  346. Spawn(function()
  347. Tween(lw,cfn()*ang(mr(35),mr(5),mr(20)),0.2)
  348. end)
  349. Tween(rw,cfn(0,0,1.3)*ang(mr(30),mr(15),mr(60)),0.2)
  350. deb=false
  351. combo=false
  352. wait(3)
  353. if combo==false then Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)),0.4) Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.4) end
  354. end}
  355. }
  356.  
  357.  
  358. rj.C0=cfn()
  359. rj.C1=cfn()
  360.  
  361.  
  362.  
  363. Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)))
  364.  
  365. Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)))
  366.  
  367. drawLine=function(point_a,point_b,bc_code)
  368. local dist=(point_a-point_b).magnitude;
  369. local rad=dist/2;
  370. local line=Instance.new('Part',tube) --reparent as u wish
  371. line.Material = 'SmoothPlastic'
  372. line.FrontSurface = 10
  373. line.BackSurface = 10
  374. line.LeftSurface = 10
  375. line.RightSurface = 10
  376. line.TopSurface = 10
  377. line.BottomSurface = 10
  378. line.Anchored=true;
  379. line.FormFactor='Custom';
  380. --line.Transparency=0.4
  381. line.Color=BrickColor.new(bc_code).Color;
  382. line.CanCollide=false;
  383. line.Size=Vector3.new(.1,.1,dist);
  384. Instance.new("BlockMesh",line).Name='blok'
  385. line.CFrame=CFrame.new(point_a,point_b)*CFrame.new(0,0,-rad);
  386. return line;
  387. end;
  388. last=tip.CFrame;
  389. sprint=false
  390. gbg=nil
  391. ghax=nil
  392. gweld=nil
  393. haxing=false
  394. shield=false
  395.  
  396. m.Button1Down:connect(function()
  397. if deb==false and haxing==false and sheathed==false and shield==false then
  398. attacks[math.random(1,#attacks)][1]()
  399. end
  400. end)
  401.  
  402. m.KeyDown:connect(function(key)
  403. if string.byte(key)==48 then
  404. if deb==false then
  405. deb=true
  406. sprint=true
  407. Spawn(function()
  408. Tween(rw,cfn()*ang(mr(45),mr(-5),mr(-10)),0.3)
  409. end)
  410. Tween(lw,cfn()*ang(mr(45),mr(5),mr(10)),0.3)
  411. ch.Humanoid.WalkSpeed=35
  412. end
  413. end
  414. if key=='f' and shield==false and deb==false and combo==false and sheathed==false then
  415. shield=true
  416. combo=true
  417. local bg = Instance.new("BodyGyro",tor)
  418. bg.maxTorque = Vector3.new(1,1,1)*9e7
  419. gbg=bg
  420. game:service'RunService'.Stepped:connect(function()
  421. bg.cframe = CFrame.new(tor.Position,mouse.Hit.p*Vector3.new(1,0,1)+tor.Position*Vector3.new(0,1,0)) * CFrame.Angles(0,math.rad(-90),0)
  422. end)
  423. Tween(lw,cfn()*ang(mr(0),mr(0),mr(90)),0.2)
  424. local shd=cp(tube,"Bright yellow",Vector3.new(3.4,3.4,0.2),false,true)
  425. shd.Transparency=1
  426. local shdw=weld(ch['Left Arm'],shd,CFrame.new(0,-1,0)*ang(mr(90),0,0))
  427. gweld=shdw
  428. ghax=shd
  429.  
  430. local shdp1=cp(shd,"Br. yellowish orange",Vector3.new(3,3,0.2))
  431. blo(shdp1).Scale=Vector3.new(1.01,1,1.01)
  432. weld(shd,shdp1,cfn())
  433. shdp1.Transparency=1
  434.  
  435. local shdp2=cp(shd,"Br. yellowish orange",Vector3.new(3,0.3,0.2),false,true)
  436. blo(shdp2).Scale=Vector3.new(1.01,1,1.01)
  437. shdp2.Transparency=1
  438. weld(shd,shdp2,cfn(0,2.2,0))
  439.  
  440. local shdp3=cp(shd,"Br. yellowish orange",Vector3.new(2.5,0.3,0.2),false,true)
  441. blo(shdp3).Scale=Vector3.new(1.01,1,1.01)
  442. shdp3.Transparency=1
  443. weld(shd,shdp3,cfn(0,-2.2,0))
  444.  
  445. for i=1,5 do
  446. wait()
  447. shd.Transparency=shd.Transparency-0.15
  448. shdp1.Transparency=shdp1.Transparency-0.15
  449. shdp2.Transparency=shdp2.Transparency-0.15
  450. shdp3.Transparency=shdp3.Transparency-0.15
  451. end
  452.  
  453.  
  454. end
  455. end)
  456.  
  457.  
  458.  
  459.  
  460. lasta=nil
  461.  
  462. cnct=function(prt)
  463. local lastz=prt.CFrame
  464. Spawn(function()
  465. while wait() do
  466. coroutine.resume(coroutine.create(function()
  467. local a=prt
  468. local c=a.CFrame;
  469. local m=(c.p-lastz.p).magnitude;
  470. if(m>1)then
  471. local l=drawLine(lastz.p,c.p,'Bright yellow');
  472. lastz=c;
  473. for i=1,10 do
  474. wait()
  475. l.Transparency=l.Transparency+0.1
  476. l.blok.Scale=l.blok.Scale-Vector3.new(0.1,0.1,0)
  477. end
  478. game:service'Debris':addItem(l,1);
  479.  
  480. end;
  481. end));
  482. end
  483. end)
  484. end
  485.  
  486. m.KeyUp:connect(function(key)
  487. if string.byte(key)==48 then
  488. if deb==true then
  489. Spawn(function()
  490. Tween(rw,cfn()*ang(mr(-15),mr(-5),mr(-10)),0.3)
  491. end)
  492. Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.3)
  493. ch.Humanoid.WalkSpeed=16
  494. deb=false
  495. sprint=false
  496. end
  497. end
  498. if key=='q' then
  499. if sheathed==false and combo==false and shield==false and deb==false then
  500. deb=true
  501. combo=true
  502. sheath()
  503. combo=false
  504. deb=false
  505. elseif sheathed==true and combo==false and deb==false then
  506. deb=true
  507. unsheath()
  508. deb=false
  509. end
  510. elseif key=='f' and shield==true then
  511. ypcall(function()
  512. gbg:Destroy()
  513. end)
  514. Tween(lw,cfn()*ang(mr(15),mr(5),mr(10)),0.2)
  515. combo=false
  516. local a=ghax:children()
  517. for i=1,5 do
  518. wait()
  519. ghax.Transparency=ghax.Transparency+0.15
  520. for _,v in pairs(a) do
  521. if v.className=='Part' then
  522. v.Transparency=v.Transparency+0.15
  523. end
  524. end
  525. end
  526. ghax:Destroy()
  527. gweld:Destroy()
  528. shield=false
  529. end
  530. end)
  531.  
  532. atdeb=false
  533. lastthing=nil
  534.  
  535. blade.Touched:connect(function(p)
  536. if atdeb==false then
  537. if p.Parent:findFirstChild("Humanoid") and deb==true and sprint==false then
  538. atdeb=true
  539. hitS:Play()
  540. p.Parent.Humanoid.Health=p.Parent.Humanoid.Health-math.random(25,35)
  541. lastthing=p.Parent.Name
  542. wait(0.65)
  543. atdeb=false
  544. end
  545. end
  546. end)
  547.  
  548.  
  549.  
  550. while wait() do
  551. if deb==false then
  552. last=tip.CFrame
  553. --Tween(rw,cfn()*ang(mr(-70),mr(-40),0),0.02)
  554. --Tween(rw,cfn()*ang(mr(-60),mr(-30),0),0.02)
  555. else
  556. coroutine.resume(coroutine.create(function()
  557. local a=tube:waitForChild'tip'
  558. local c=a.CFrame;
  559. local m=(c.p-last.p).magnitude;
  560. if(m>1)then
  561. local l=drawLine(last.p,c.p,'Bright yellow');
  562. last=c;
  563. for i=1,10 do
  564. wait()
  565. l.Transparency=l.Transparency+0.1
  566. l.blok.Scale=l.blok.Scale-Vector3.new(0.1,0.1,0)
  567. end
  568. game:service'Debris':addItem(l,1);
  569.  
  570. end;
  571. end));
  572. end
  573. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement