Guest User

Untitled

a guest
Jul 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.64 KB | None | 0 0
  1. --- shortcuts
  2.  
  3. v3 = Vector3.new
  4.  
  5. cn = CFrame.new
  6.  
  7. ca2 = CFrame.Angles
  8.  
  9. mf = math.floor
  10.  
  11. mran = math.random
  12.  
  13. mrad = math.rad
  14.  
  15. mdeg = math.deg
  16.  
  17. ca = function(x,y,z) return ca2(mrad(x),mrad(y),mrad(z)) end
  18.  
  19. mran2 = function(a,b) return mran(a*1000,b*1000)/1000 end
  20.  
  21. ud=UDim2.new
  22.  
  23. bn = BrickColor.new
  24.  
  25. c3 = Color3.new
  26.  
  27. -----
  28.  
  29. Player = game:service'Players'.LocalPlayer
  30.  
  31. Char = Player.Character
  32.  
  33. Torso = Char.Torso
  34.  
  35. Head = Char.Head
  36.  
  37. Humanoid = Char.Humanoid
  38.  
  39. Root=Char.HumanoidRootPart.RootJoint
  40.  
  41.  
  42.  
  43.  
  44. LA=Char['Left Arm']
  45.  
  46. RA=Char['Right Arm']
  47.  
  48. LL=Char['Left Leg']
  49.  
  50. RL=Char['Right Leg']
  51.  
  52. LAM=Torso['Left Shoulder']
  53.  
  54. RAM=Torso['Right Shoulder']
  55.  
  56. LLM=Torso['Left Hip']
  57.  
  58. RLM=Torso['Right Hip']
  59.  
  60. Neck=Torso.Neck
  61.  
  62. Neck.C0=cn(0,1.5,0)
  63.  
  64. Neck.C1=cn(0,0,0)
  65.  
  66.  
  67.  
  68.  
  69. name='New'
  70.  
  71. pcall(function() Player.Backpack[name]:Remove() end)
  72.  
  73. pcall(function() Char[name]:Remove() end)
  74.  
  75. pcall(function() Char.Block:Remove() end)
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. as,so={},{'metal','Block','Slash','Slash2','Hit','Kick'}
  84.  
  85. as.corner='11294911'
  86.  
  87. as.cone='1033714'
  88.  
  89. as.ring="3270017"
  90.  
  91. as.Chakram='47260990'
  92.  
  93. as.ring2='18430887'
  94.  
  95. as.blast='20329976'
  96.  
  97. as.missile='10207677'
  98.  
  99. as.fire='2693346'
  100.  
  101. as.boom='3264793'
  102.  
  103. as.slash='10209645'
  104.  
  105. as.abscond='2767090'
  106.  
  107. as.firelaser='13775494'
  108.  
  109. as.diamond='9756362'
  110.  
  111. as.metal='rbxasset://sounds\\unsheath.wav'
  112.  
  113. as.Block = 'rbxasset://sounds\\metal.ogg'
  114.  
  115. as.Slash = '10209645'
  116.  
  117. as.Slash2 = '46760716'
  118.  
  119. as.Hit='10209583'
  120.  
  121. as.Kick='46153268'
  122.  
  123. as.cast='2101137'
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. for i,v in pairs(as) do
  132.  
  133. if type(tonumber(v:sub(1,3)))=="number" then
  134.  
  135. as[i]="http://www.roblox.com/asset/?id="..v
  136.  
  137. end
  138.  
  139. end
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. iNew=function(tab)
  148.  
  149. local v=Instance.new(tab[1])
  150.  
  151. for Ind,Val in pairs(tab) do
  152.  
  153. if Ind~=1 and Ind~=2 then
  154.  
  155. v[Ind] = Val
  156.  
  157. end
  158.  
  159. end
  160.  
  161. v.Parent=tab[2]==0 and LastMade or tab[2]
  162.  
  163. LastMade=v
  164.  
  165. return v
  166.  
  167. end
  168.  
  169. iPart=function(tab)
  170.  
  171. local v=Instance.new(tab.type or 'Part')
  172.  
  173. if tab.type~='CornerWedgePart' then v.formFactor='Custom' end
  174.  
  175. v.CanCollide=false
  176.  
  177. v.TopSurface=0 v.BottomSurface=0
  178.  
  179. v.Size=v3(tab[2],tab[3],tab[4])
  180.  
  181. if tab.co then v.BrickColor=bn(tab.co) end
  182.  
  183. if tab.tr then v.Transparency=tab.tr end
  184.  
  185. if tab.rf then v.Reflectance=tab.rf end
  186.  
  187. if tab.cf then v.CFrame=tab.cf end
  188.  
  189. if tab.an then v.Anchored=tab.an end
  190.  
  191. v.Parent=tab[1]
  192.  
  193. LastMade=v
  194.  
  195. return v
  196.  
  197. end
  198.  
  199. function getoutline(x,z,i)
  200.  
  201. return math.sqrt(x^2+z^2)+(i or 0.05),mdeg(math.atan2(x,z))
  202.  
  203. end
  204.  
  205. pcall(function() Torso.LAW:Remove() Torso.RAW:Remove() Torso.LLW:Remove() Torso.RLW:Remove() end)
  206.  
  207. LAW=iNew{'Weld',Torso,Name='LAW',Part0=Torso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)}
  208.  
  209. RAW=iNew{'Weld',Torso,Name='RAW',Part0=Torso,C0=cn( 1.5,0.5,0),C1=cn(0,0.5,0)}
  210.  
  211. LLW=iNew{'Weld',Torso,Name='LLW',Part0=Torso,C0=cn(-0.5, -1,0),C1=cn(0, 1,0)}
  212.  
  213. RLW=iNew{'Weld',Torso,Name='RLW',Part0=Torso,C0=cn( 0.5, -1,0),C1=cn(0, 1,0)}
  214.  
  215. function Arms(on)
  216.  
  217. LAM.Parent=Torso LAM.Part0=Torso
  218.  
  219. RAM.Parent=Torso RAM.Part0=Torso
  220.  
  221. LAM.Part1=on and nil or LA
  222.  
  223. RAM.Part1=on and nil or RA
  224.  
  225. LAW.Part1=on and LA or nil
  226.  
  227. RAW.Part1=on and RA or nil
  228.  
  229. end
  230.  
  231. function Legs(on)
  232.  
  233. LLM.Part1=on and nil or LL
  234.  
  235. RLM.Part1=on and nil or RL
  236.  
  237. LLW.Part1=on and LL or nil
  238.  
  239. RLW.Part1=on and RL or nil
  240.  
  241. end
  242.  
  243. function v32(cf)
  244.  
  245. local x,y,z=cf:toEulerAnglesXYZ()
  246.  
  247. return v3(mdeg(x),mdeg(y),mdeg(z))
  248.  
  249. end
  250.  
  251. function GetWeld(weld)
  252.  
  253. if not weld:findFirstChild("Angle") then
  254.  
  255. local a = Instance.new("Vector3Value", weld)
  256.  
  257. a.Name = "Angle"
  258.  
  259. local x,y,z=weld.C0:toEulerAnglesXYZ()
  260.  
  261. a.Value=v3(mdeg(x),mdeg(y),mdeg(z))
  262.  
  263. end
  264.  
  265. return weld.C0.p,weld.Angle.Value
  266.  
  267. end
  268.  
  269. function ClearWeld(weld)
  270.  
  271. if weld:findFirstChild'Angle' then weld.Angle:Remove() end
  272.  
  273. end
  274.  
  275. function SetWeld(weld,CC,i, loops, origpos,origangle, nextpos,nextangle,smooth)
  276.  
  277. local CO='C'..CC
  278.  
  279. smooth = smooth or 1
  280.  
  281. if not weld:findFirstChild("Angle") then
  282.  
  283. local a = Instance.new("Vector3Value", weld)
  284.  
  285. a.Name = "Angle"
  286.  
  287. local x,y,z=weld.C0:toEulerAnglesXYZ()
  288.  
  289. a.Value=v3(mdeg(x),mdeg(y),mdeg(z))
  290.  
  291. end
  292.  
  293.  
  294.  
  295. local perc
  296.  
  297. if smooth == 1 then
  298.  
  299. perc = math.sin((math.pi/2)/loops*i)
  300.  
  301. else
  302.  
  303. perc = i/loops
  304.  
  305. end
  306.  
  307.  
  308.  
  309. local tox,toy,toz = 0,0,0
  310.  
  311. if origangle.x > nextangle.x then
  312.  
  313. tox = -math.abs(origangle.x - nextangle.x) *perc
  314.  
  315. else
  316.  
  317. tox = math.abs(origangle.x - nextangle.x) *perc
  318.  
  319. end
  320.  
  321. if origangle.y > nextangle.y then
  322.  
  323. toy = -math.abs(origangle.y - nextangle.y) *perc
  324.  
  325. else
  326.  
  327. toy = math.abs(origangle.y - nextangle.y) *perc
  328.  
  329. end
  330.  
  331. if origangle.z > nextangle.z then
  332.  
  333. toz = -math.abs(origangle.z - nextangle.z) *perc
  334.  
  335. else
  336.  
  337. toz = math.abs(origangle.z - nextangle.z) *perc
  338.  
  339. end
  340.  
  341.  
  342.  
  343. local tox2,toy2,toz2 = 0,0,0
  344.  
  345. if origpos.x > nextpos.x then
  346.  
  347. tox2 = -math.abs(origpos.x - nextpos.x) *perc
  348.  
  349. else
  350.  
  351. tox2 = math.abs(origpos.x - nextpos.x) *perc
  352.  
  353. end
  354.  
  355. if origpos.y > nextpos.y then
  356.  
  357. toy2 = -math.abs(origpos.y - nextpos.y) *perc
  358.  
  359. else
  360.  
  361. toy2 = math.abs(origpos.y - nextpos.y) *perc
  362.  
  363. end
  364.  
  365. if origpos.z > nextpos.z then
  366.  
  367. toz2 = -math.abs(origpos.z - nextpos.z) *perc
  368.  
  369. else
  370.  
  371. toz2 = math.abs(origpos.z - nextpos.z) *perc
  372.  
  373. end
  374.  
  375. weld.Angle.Value = Vector3.new(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  376.  
  377. weld[CO] = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  378.  
  379. end
  380.  
  381. LoopFunctions={}
  382.  
  383. function DoLoop(times,func)
  384.  
  385. LoopFunctions[#LoopFunctions+1]={times,0,func}
  386.  
  387. end
  388.  
  389. Dmg=false
  390.  
  391. Dmgv={8,16}
  392.  
  393. HitDebounce={}
  394.  
  395. Damage=function(Hum,Mult,Sound)
  396.  
  397. if not Hum.Parent:findFirstChild'Torso' then return end
  398.  
  399. local HName=Hum.Parent.Name
  400.  
  401. if HitDebounce[HName] and HitDebounce[HName]>tick() then return end
  402.  
  403. HitDebounce[HName]=tick()+0.5
  404.  
  405. local Mult=Mult or 1
  406.  
  407. local Dealt=mran(Dmgv[1],Dmgv[2])*Mult
  408.  
  409. local col=''
  410.  
  411. if Hum.Parent:findFirstChild'Block' and Hum.Parent.Block.Value>0 then
  412.  
  413. Hum.Parent.Block.Value=Hum.Parent.Block.Value-1
  414.  
  415. col='Bright blue'
  416.  
  417. else
  418.  
  419. Hum.Health=Hum.Health-Dealt
  420.  
  421. col='Bright red'
  422.  
  423. end
  424.  
  425. if Sound then so[col=='Bright blue' and 'Block' or 'Hit']:Play() end
  426.  
  427. local DoH=iNew{'Model',Pack,Name=col=='Bright blue' and 'Block' or Dealt}
  428.  
  429. iNew{'Humanoid',DoH,MaxHealth=1/0,Health=1/0,Name=''}
  430.  
  431. local Doh=iPart{DoH,0.6,0.2,0.6,co=col,an=true} Doh.Name='Head' iNew{'CylinderMesh',Doh}
  432.  
  433. local dofs=Hum.Parent.Torso.CFrame*cn(mran2(-1.5,1.5),2.5,mran2(-1,1)) Doh.CFrame=dofs
  434.  
  435. DoLoop(40,function(i) Doh.CFrame=dofs*cn(0,i*2,0) Doh.Transparency=i-0.5 if i==1 then DoH:Remove() end end)
  436.  
  437. end
  438.  
  439.  
  440.  
  441.  
  442. Trails={}
  443.  
  444. TrailPack={}
  445.  
  446. Traili={}
  447.  
  448. function Trail(obj,ofs,col)
  449.  
  450. Trails[obj]=true
  451.  
  452. Traili[#Traili+1]={obj,ofs,col,obj.CFrame*ofs}
  453.  
  454. end
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468. CC={'Dark stone grey','Light stone grey','Black'}
  469.  
  470. SHH=0.25
  471.  
  472. Handlelen=8.5
  473.  
  474.  
  475.  
  476.  
  477. Tool=iNew{'HopperBin',Player.Backpack,Name=name}
  478.  
  479. Pack=iNew{'Model',Char,Name=name}
  480.  
  481.  
  482.  
  483.  
  484. Shield=iPart{Pack,1.05,0.2,1.05,co=CC[1],tr=1}
  485.  
  486. wShield=iNew{'Weld',Pack,Part0=Torso,Part1=Shield,C0=cn(0,0.6,0)*ca(90,0,-90)}
  487.  
  488.  
  489.  
  490.  
  491. shield=iPart{Pack,1.5,2,SHH,co=CC[2]}
  492.  
  493. wwhield=iNew{'Weld',Pack,Part0=Shield,Part1=shield,C0=cn(-0.5-(SHH/2),0,-0.4)*ca(0,90,-90)}
  494.  
  495.  
  496.  
  497.  
  498. prop=iPart{Pack,3,1.5,SHH-0.01,co=CC[2]} -- wide
  499.  
  500. iNew{'Weld',Pack,Part0=shield,Part1=prop,C0=cn(0,0,0)}
  501.  
  502.  
  503.  
  504.  
  505. prop=iPart{Pack,1,1,SHH,co=CC[2]} --top
  506.  
  507. iNew{'Weld',Pack,Part0=shield,Part1=prop,C0=cn(0,1.5,0)}
  508.  
  509.  
  510.  
  511.  
  512. prop=iPart{Pack,1,2,SHH,co=CC[2]} --bottom
  513.  
  514. iNew{'Weld',Pack,Part0=shield,Part1=prop,C0=cn(0,-2,0)}
  515.  
  516.  
  517.  
  518.  
  519. for x=-1,1,2 do
  520.  
  521. Prop=iPart{Pack,SHH,1,0.25,co=CC[2],type='WedgePart'}
  522.  
  523. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.625*x,1.5,0)*ca(0,-90*x,0)}
  524.  
  525. Prop=iPart{Pack,SHH,0.25,0.5,co=CC[2],type='WedgePart'}
  526.  
  527. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.25*x,2.125,0)*ca(0,-90*x,0)}
  528.  
  529. Prop=iPart{Pack,SHH,1,0.75,co=CC[2],type='WedgePart'}
  530.  
  531. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.75/2*x,-3.5,0)*ca(180,-90*x,0)}
  532.  
  533. for y=-1,1,2 do
  534.  
  535. Prop=iPart{Pack,SHH,0.25,0.75,co=CC[2],type='WedgePart'}
  536.  
  537. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(1.125*x,(1-0.125)*y,0)*ca(y==-1 and 180 or 0,-90*x,0)}
  538.  
  539. Prop=iPart{Pack,SHH,0.75,0.25,co=CC[2],type='WedgePart'}
  540.  
  541. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(1.625*x,0.75/2*y,0)*ca(y==-1 and 180 or 0,-90*x,0)}
  542.  
  543. Prop=iPart{Pack,SHH,1,0.25,co=CC[2],type='WedgePart'}
  544.  
  545. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.625*x,(0.5*-y)-2,0)*ca(y==-1 and 180 or 0,-90*x,0)}
  546.  
  547. end
  548.  
  549. end
  550.  
  551. -- outline
  552.  
  553. outth=0.1
  554.  
  555. SHH2=SHH+0.1
  556.  
  557. for x=-1,1,2 do
  558.  
  559. local len,rot=getoutline(1,0.25)
  560.  
  561. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  562.  
  563. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.625*x,-2.5,0)*ca(0,0,-rot*x+90)}
  564.  
  565. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  566.  
  567. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.625*x,-1.5,0)*ca(0,0,rot*x+90)}
  568.  
  569. local len,rot=getoutline(1,0.75)
  570.  
  571. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  572.  
  573. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.75/2*x,-3.5,0)*ca(0,0,rot*x+90)}
  574.  
  575. local len,rot=getoutline(1,0.75)
  576.  
  577. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  578.  
  579. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.75/2*x,-3.5,0)*ca(0,0,rot*x+90)}
  580.  
  581. local len,rot=getoutline(1,0.25)
  582.  
  583. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  584.  
  585. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.625*x,1.5,0)*ca(0,0,-rot*x-90)}
  586.  
  587. local len,rot=getoutline(0.25,0.5)
  588.  
  589. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  590.  
  591. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(0.25*x,2.125,0)*ca(0,0,-rot*x-90)}
  592.  
  593. for y=-1,1,2 do
  594.  
  595. local len,rot=getoutline(0.75,0.25)
  596.  
  597. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  598.  
  599. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(1.625*x,0.75/2*y,0)*ca(0,0,rot*x*-y+90)}
  600.  
  601. local len,rot=getoutline(0.25,0.75)
  602.  
  603. Prop=iPart{Pack,0.2,len,SHH2,co=CC[1]} iNew{'BlockMesh',Prop,Scale=v3(outth*5,1,1)}
  604.  
  605. iNew{'Weld',Pack,Part0=shield,Part1=Prop,C0=cn(1.125*x,(1-0.125)*y,0)*ca(0,0,rot*x*-y+90)}
  606.  
  607. end
  608.  
  609. end
  610.  
  611.  
  612.  
  613.  
  614. ---Weapon
  615.  
  616. Handle=iPart{Pack,0.5,2,0.5,co=CC[3]} iNew{'CylinderMesh',0}
  617.  
  618. wHandle=iNew{'Weld',Pack,Part0=Torso,Part1=Handle,C0=cn(2,3,0.75+SHH)*ca(-90,-45,90)}
  619.  
  620. --C0=cn(0,-1.25,0.3)*ca(-90,0,0)
  621.  
  622. prop=iPart{Pack,0.5,2,0.5,co=CC[3]} iNew{'SpecialMesh',0,MeshId=as.cone,Scale=v3(0.25,2.3,0.25)}
  623.  
  624. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,-1,0)*ca(160,0,0)*cn(0,0.8,0)}
  625.  
  626. prop=iPart{Pack,0.7,0.7,0.7,co=CC[3]} iNew{'SpecialMesh',0,MeshType='Sphere'}
  627.  
  628. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,1,0)}
  629.  
  630. prop=iPart{Pack,0.7,0.2,0.7,co=CC[3]} iNew{'CylinderMesh',0}
  631.  
  632. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,1.3,0)}
  633.  
  634. --
  635.  
  636. for x=-1,1,2 do
  637.  
  638. prop=iPart{Pack,0.4,0.4,0.8,co=CC[3],type='WedgePart'}
  639.  
  640. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0.4*x/2,1.4,0)*ca(25,180,90*x)*cn(0,0,-0.4)}
  641.  
  642. prop=iPart{Pack,0.4,0.4,0.8,co=CC[3],type='WedgePart'}
  643.  
  644. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(-0.4*x/2,1.4,0)*ca(25,0,90*x)*cn(0,0,-0.4)}
  645.  
  646. for i=-1,1,2 do
  647.  
  648. local le=i==-1 and 0.5 or 0.85
  649.  
  650. prop=iPart{Pack,le,0.4,0.8,co=CC[3],type='WedgePart'}
  651.  
  652. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0.4*x/2*i,1.6+(0.25-(le/2-0.25)),0.4*i)*ca(0,i==1 and 180 or 0,90*x)}
  653.  
  654. end
  655.  
  656. end
  657.  
  658. local len=6
  659.  
  660. local a,b=getoutline(0.4,0.8,0)
  661.  
  662. local aa,bb=getoutline(0.4,len,0)
  663.  
  664. prop=iPart{Pack,1,1,a,co=CC[3],type='WedgePart'} iNew{'SpecialMesh',0,Scale=v3(0.02,aa,1),MeshType='Wedge'}
  665.  
  666. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,2.1+len/2,-0.4)*ca(0,0,bb)*ca(0,b,0)}
  667.  
  668. prop=iPart{Pack,1,1,a,co=CC[3],type='WedgePart'} iNew{'SpecialMesh',0,Scale=v3(0.02,aa,1),MeshType='Wedge'}
  669.  
  670. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,2.1+len/2,-0.4)*ca(0,0,-bb)*ca(0,-b,0)}
  671.  
  672. prop=iPart{Pack,1,1,a,co=CC[3],type='WedgePart'} iNew{'SpecialMesh',0,Scale=v3(0.02,aa,1),MeshType='Wedge'}
  673.  
  674. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,2.1+len/2,0.4)*ca(0,0,bb)*ca(0,-b,0)*ca(0,180,0)}
  675.  
  676. prop=iPart{Pack,1,1,a,co=CC[3],type='WedgePart'} iNew{'SpecialMesh',0,Scale=v3(0.02,aa,1),MeshType='Wedge'}
  677.  
  678. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,2.1+len/2,0.4)*ca(0,0,-bb)*ca(0,b,0)*ca(0,180,0)}
  679.  
  680. local sc=0.85
  681.  
  682. for x=-1,1,2 do
  683.  
  684. rune=iPart{Pack,sc,1,sc,co=''} iNew{'CylinderMesh',0,Scale=v3(1,0.08,1)}
  685.  
  686. iNew{'Weld',Pack,Part0=Handle,Part1=rune,C0=cn(0.2*x,2.1+0.5,-0.36)*ca(0,0,bb*x)*ca(0,b*x,90)*ca(0,-4,0)}
  687.  
  688. prop=iPart{Pack,sc/2.5,1,sc/2.5,co='Navy blue'} iNew{'CylinderMesh',0,Scale=v3(1,0.09,1)}
  689.  
  690. iNew{'Weld',Pack,Part0=rune,Part1=prop}
  691.  
  692. prop=iPart{Pack,0.5,0.2,0.5,co='Dark stone grey'} iNew{'SpecialMesh',0,Scale=v3(0.6,0.6,1.4)*sc,MeshId=as.ring2}
  693.  
  694. iNew{'Weld',Pack,Part0=rune,Part1=prop,C0=ca(90,0,0)}
  695.  
  696. prop=iPart{Pack,0.2,0.2,0.2,co='Black',rf=0.25} iNew{'SpecialMesh',0,Scale=v3(0.02,2.4,0.35),MeshId=as.cone}
  697.  
  698. iNew{'Weld',Pack,Part0=rune,Part1=prop,C0=cn(1.2,0,0)*ca(0,0,-90)}
  699.  
  700. for i=0,360,90 do
  701.  
  702. prop=iPart{Pack,0.2,0.2,0.2,co='Black'} iNew{'CylinderMesh',0,Scale=v3(0.9,0.09*5,0.9)}
  703.  
  704. iNew{'Weld',Pack,Part0=rune,Part1=prop,C0=ca(0,i+45,0)*cn(0,0,sc/3)}
  705.  
  706. end
  707.  
  708. end
  709.  
  710. prop=iPart{Pack,0.35,1,0.5,co='Black',type='WedgePart'}
  711.  
  712. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,0,-0.4)*ca(0,0,0)}
  713.  
  714. prop=iPart{Pack,0.35,0.5,0.5,co='Black',type='WedgePart'}
  715.  
  716. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,-0.75,-0.4)*ca(0,0,180)}
  717.  
  718. for x=0,100,100/5 do
  719.  
  720. prop=iPart{Pack,0.2,0.35,0.2,co='Black'} iNew{'CylinderMesh',0}
  721.  
  722. iNew{'Weld',Pack,Part0=Handle,Part1=prop,C0=cn(0,-1.1,0.275)*ca(105+x,0,0)*cn(0,0,0.75)}
  723.  
  724. end
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732. HitBox=iPart{Pack,0.2,7,1.5,co='Black',tr=1}
  733.  
  734. HitBoxCF=cn(0,5,0)
  735.  
  736. --iNew{'Weld',Pack,Part0=Handle,Part1=HitBox,C0=cn(0,5,0)}
  737.  
  738.  
  739.  
  740.  
  741. HitBox.Touched:connect(function(hit)
  742.  
  743. if not Dmg then return end
  744.  
  745. if hit.Parent==Char then return end
  746.  
  747. if hit.Parent:findFirstChild'Humanoid' then
  748.  
  749. local h=hit.Parent.Humanoid
  750.  
  751. Damage(h,1,true)
  752.  
  753. end
  754.  
  755. end)
  756.  
  757.  
  758.  
  759.  
  760. for i,v in pairs(Torso:children()) do
  761.  
  762. if v:IsA'Sound' then v:Remove() end
  763.  
  764. end
  765.  
  766. for i,n in pairs(so) do
  767.  
  768. local v=iNew{'Sound',Torso,Volume=1,Pitch=1,Looped=false,Name=v,SoundId=as[n]}
  769.  
  770. so[n]=v
  771.  
  772. end
  773.  
  774.  
  775.  
  776.  
  777. function RePose()
  778.  
  779. local a,b=GetWeld(LAW)
  780.  
  781. local c,d=GetWeld(RAW)
  782.  
  783. --local e,f=GetWeld(wShield)
  784.  
  785. local g,h=GetWeld(wHandle)
  786.  
  787. local i,j=GetWeld(Root)
  788.  
  789. local k,l=GetWeld(Neck)
  790.  
  791. oPoseLA=a oPoseLA2=b
  792.  
  793. oPoseRA=c oPoseRA2=d
  794.  
  795. --oPoseShield=e oPoseShield2=f
  796.  
  797. oPoseHandle=g oPoseHandle2=h
  798.  
  799. oPoseRT=i oPoseRT2=j
  800.  
  801. oPoseNE=k oPoseNE2=l
  802.  
  803. end
  804.  
  805. function ReturnPose()
  806.  
  807. local wLA,wLA2=GetWeld(LAW)
  808.  
  809. local wRA,wRA2=GetWeld(RAW)
  810.  
  811. local wRT,wRT2=GetWeld(Root)
  812.  
  813. local AA,AA2=GetWeld(wShield)
  814.  
  815. local BB,BB2=GetWeld(wHandle)
  816.  
  817. local wNE,wNE2=GetWeld(Neck)
  818.  
  819. for i=1,ASpeed do
  820.  
  821. SetWeld(LAW,0,i,ASpeed,wLA,wLA2,PoseLA,PoseLA2,1)
  822.  
  823. SetWeld(RAW,0,i,ASpeed,wRA,wRA2,PoseRA,PoseRA2,1)
  824.  
  825. SetWeld(wShield,0,i,ASpeed,AA,AA2,v3(0,0,0),v3(0,0,0),1)
  826.  
  827. SetWeld(wHandle,0,i,ASpeed,BB,BB2,PoseHandle,PoseHandle2,1)
  828.  
  829. SetWeld(Root,0,i,ASpeed,wRT,wRT2,PoseRT,PoseRT2,1)
  830.  
  831. SetWeld(Neck,0,i,ASpeed,wNE,wNE2,PoseNE,PoseNE2,1)
  832.  
  833. wait()
  834.  
  835. end
  836.  
  837. end
  838.  
  839. function TorsoROT(i,rot)
  840.  
  841. SetWeld(Root,0,i,ASpeed,oPoseRT,oPoseRT2,PoseRT,v3(0,rot,0),1)
  842.  
  843. SetWeld(Neck,0,i,ASpeed,oPoseNE,oPoseNE2,PoseNE,v3(0,-rot,0),1)
  844.  
  845. end
  846.  
  847.  
  848.  
  849.  
  850. Block=iNew{'NumberValue',Char,Name='Block',Value=0}
  851.  
  852.  
  853.  
  854.  
  855. key={}
  856.  
  857. Tool.Selected:connect(function(mouse)
  858.  
  859. print'Selected'
  860.  
  861. Mouse=mouse
  862.  
  863. if Anim=='None' then
  864.  
  865. Anim='Equipping'
  866.  
  867. Arms(0)
  868.  
  869. for i=1,ASpeed do
  870.  
  871. SetWeld(LAW,0,i,ASpeed,OrigLA,OrigLA2,OrigLA,v3(90,0,-90),1)
  872.  
  873. SetWeld(RAW,0,i,ASpeed,OrigRA,OrigRA2,OrigRA,v3(200,0,0),1)
  874.  
  875. wait()
  876.  
  877. end
  878.  
  879. local ofs = LA.CFrame:toObjectSpace(Shield.CFrame)
  880.  
  881. wShield.Part0=LA wShield.C0=ofs ClearWeld(wShield)
  882.  
  883. local AA,AA2=GetWeld(wShield)
  884.  
  885. local ofs = RA.CFrame:toObjectSpace(Handle.CFrame)
  886.  
  887. wHandle.Part0=RA wHandle.C0=ofs ClearWeld(wHandle)
  888.  
  889. local BB,BB2=GetWeld(wHandle)
  890.  
  891. for i=1,ASpeed do
  892.  
  893. SetWeld(wShield,0,i,ASpeed,AA,AA2,v3(0,0,0),v3(0,0,0),1)
  894.  
  895. SetWeld(wHandle,0,i,ASpeed,BB,BB2,PoseHandle,PoseHandle2,1)
  896.  
  897. wait()
  898.  
  899. end
  900.  
  901. ReturnPose()
  902.  
  903. Anim='Equipped'
  904.  
  905. end
  906.  
  907. Mouse.KeyDown:connect(function(k)
  908.  
  909. key[k]=true
  910.  
  911. if Anim=='Equipped' and k=='f' then
  912.  
  913. Anim='Block'
  914.  
  915. RePose()
  916.  
  917. for i=1,ASpeed do
  918.  
  919. SetWeld(LAW,0,i,ASpeed,oPoseLA,oPoseLA2,v3(-1.25,0.5,-0.5),v3(90,0,45),1)
  920.  
  921. SetWeld(RAW,0,i,ASpeed,oPoseRA,oPoseRA2,v3(1.5,0.5,0),v3(-45,0,-20),1)
  922.  
  923. SetWeld(wHandle,0,i,ASpeed,oPoseHandle,oPoseHandle2,PoseHandle+v3(0,-0.2,0),v3(-90,-20,-60),1)
  924.  
  925. TorsoROT(i,-45)
  926.  
  927. wait()
  928.  
  929. end
  930.  
  931. Block.Value=mran(1,3)
  932.  
  933. so.Block:Play()
  934.  
  935. Anim='Blocking'
  936.  
  937. repeat wait() until Anim=='Blocking' and (not key[k] or Block.Value<1)
  938.  
  939. Block.Value=0
  940.  
  941. Anim=''
  942.  
  943. ReturnPose()
  944.  
  945. Anim='Equipped'
  946.  
  947. elseif Anim=='Equipped' and k=='s' then
  948.  
  949. elseif Anim=='Equipped' and k=='s' then
  950.  
  951. elseif Anim=='Equipped' and k=='s' then
  952.  
  953. end
  954.  
  955. end)--keys
  956.  
  957. Mouse.KeyUp:connect(function(k)
  958.  
  959. key[k]=false
  960.  
  961. end)
  962.  
  963. Mouse.Button1Down:connect(function()
  964.  
  965. Button1=true
  966.  
  967. if Anim=='Blocking' then
  968.  
  969. Anim='BlockCounter'
  970.  
  971. RePose()
  972.  
  973. so.Slash:Play()
  974.  
  975. Dmg=true
  976.  
  977. Trail(Handle,cn(0,Handlelen,0),'White')
  978.  
  979. for i=1,ASpeed do
  980.  
  981. SetWeld(LAW,0,i,ASpeed,oPoseLA,oPoseLA2,v3(-1.5,0.5,0),v3(0,0,-45),1)
  982.  
  983. SetWeld(RAW,0,i,ASpeed,oPoseRA,oPoseRA2,v3(1.5,0.5,0),v3(-90,0,135),1)
  984.  
  985. SetWeld(wHandle,0,i,ASpeed,oPoseHandle,oPoseHandle2,PoseHandle+v3(0,-0.2,0),v3(-90,55,-80),1)
  986.  
  987. TorsoROT(i,60)
  988.  
  989. wait()
  990.  
  991. end
  992.  
  993. Trails[Handle]=false
  994.  
  995. Dmg=false
  996.  
  997. wait(0.1)
  998.  
  999. RePose()
  1000.  
  1001. for i=1,ASpeed do -- return
  1002.  
  1003. SetWeld(LAW,0,i,ASpeed,oPoseLA,oPoseLA2,v3(-1.25,0.5,-0.5),v3(90,0,45),1)
  1004.  
  1005. SetWeld(RAW,0,i,ASpeed,oPoseRA,oPoseRA2,v3(1.5,0.5,0),v3(-45,0,-20),1)
  1006.  
  1007. SetWeld(wHandle,0,i,ASpeed,oPoseHandle,oPoseHandle2,PoseHandle+v3(0,-0.2,0),v3(-90,-20,-90),1)
  1008.  
  1009. TorsoROT(i,-45)
  1010.  
  1011. wait()
  1012.  
  1013. end
  1014.  
  1015. so.Block:Play()
  1016.  
  1017. Anim='Blocking'
  1018.  
  1019. end
  1020.  
  1021. end)
  1022.  
  1023. end) -- select
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031. Tool.Deselected:connect(function(mouse)
  1032.  
  1033. print'Deselected'
  1034.  
  1035. Mouse=nil
  1036.  
  1037. if Anim=='Equipped' then
  1038.  
  1039. Anim='Unequipping'
  1040.  
  1041. RePose()
  1042.  
  1043. for i=1,ASpeed do
  1044.  
  1045. SetWeld(LAW,0,i,ASpeed,oPoseLA,oPoseLA2,OrigLA,v3(90,0,-90),1)
  1046.  
  1047. SetWeld(RAW,0,i,ASpeed,oPoseRA,oPoseRA2,OrigRA,v3(200,0,0),1)
  1048.  
  1049. wait()
  1050.  
  1051. end
  1052.  
  1053. local ofs = Torso.CFrame:toObjectSpace(Shield.CFrame)
  1054.  
  1055. wShield.Part0=Torso wShield.C0=ofs ClearWeld(wShield)
  1056.  
  1057. local AA,AA2=GetWeld(wShield)
  1058.  
  1059. local ofs = Torso.CFrame:toObjectSpace(Handle.CFrame)
  1060.  
  1061. wHandle.Part0=Torso wHandle.C0=ofs ClearWeld(wHandle)
  1062.  
  1063. local BB,BB2=GetWeld(wHandle)
  1064.  
  1065. for i=1,ASpeed do
  1066.  
  1067. SetWeld(wShield,0,i,ASpeed,AA,AA2,v3(0,0.6,0),v3(90,0,-90),1)
  1068.  
  1069. SetWeld(wHandle,0,i,ASpeed,BB,v3(110,0,0),v3(2,3,0.75+SHH),v3(-90+180,-45-90,90-180),1)
  1070.  
  1071. wait()
  1072.  
  1073. end
  1074.  
  1075. local wLA,wLA2=GetWeld(LAW)
  1076.  
  1077. local wRA,wRA2=GetWeld(RAW)
  1078.  
  1079. for i=1,ASpeed do
  1080.  
  1081. SetWeld(LAW,0,i,ASpeed,wLA,wLA2,OrigLA,OrigLA2,1)
  1082.  
  1083. SetWeld(RAW,0,i,ASpeed,wRA,wRA2,OrigRA,OrigRA2,1)
  1084.  
  1085. wait()
  1086.  
  1087. end
  1088.  
  1089. Arms()
  1090.  
  1091. Anim='None'
  1092.  
  1093. end
  1094.  
  1095. end) --deselect
  1096.  
  1097.  
  1098.  
  1099.  
  1100. print(#Pack:children())
  1101.  
  1102. Root.C0=cn(0,0,0)*ca(0,0,0)
  1103.  
  1104. Root.C1=cn(0,0,0)*ca(0,0,0)
  1105.  
  1106. Arms()
  1107.  
  1108. Legs()
  1109.  
  1110.  
  1111.  
  1112.  
  1113. WalkAnim=0
  1114.  
  1115. Walking=false
  1116.  
  1117. Humanoid.Running:connect(function(Walk)
  1118.  
  1119. Walking=Walk>0 and true or false
  1120.  
  1121. end)
  1122.  
  1123.  
  1124.  
  1125.  
  1126. WalkSpeed={1,1,1,1,1,1,1,1}
  1127.  
  1128. Anim='None'
  1129.  
  1130. ASpeed=10
  1131.  
  1132. OrigLA=v3(-1.5,0.5,0) OrigLA2=v3(0,0,0)
  1133.  
  1134. OrigRA=v3( 1.5,0.5,0) OrigRA2=v3(0,0,0)
  1135.  
  1136. --Pose
  1137.  
  1138. PoseLA=v3(-1.5,0.5,0) PoseLA2=v3(20,0,0)
  1139.  
  1140. PoseRA=v3( 1.5,0.5,0) PoseRA2=v3(0,0,20)
  1141.  
  1142. PoseHandle=v3(0,-1,0) PoseHandle2=v3(-90,0,0)
  1143.  
  1144. PoseRT=v3(0,0,0) PoseRT2=v3(0,0,0)
  1145.  
  1146. PoseNE=v3(0,1.5,0) PoseNE2=v3(0,0,0)
  1147.  
  1148. -----
  1149.  
  1150. WPoseLA=v3(-1.25,0.5,0) WPoseLA2=v3(-35,0,-20)
  1151.  
  1152. WPoseRA=PoseRA WPoseRA2=v3(-45,5,0)
  1153.  
  1154. WPoseHandle=v3(0,-1,0) WPoseHandle2=v3(-90/1.5,0,0)
  1155.  
  1156. while Pack.Parent do
  1157.  
  1158. WalkAnim=WalkAnim+(Walking and (Anim=='Equipped' and 1 or -1) or -1)
  1159.  
  1160. if WalkAnim<0 then WalkAnim=0 elseif WalkAnim>14 then WalkAnim=14 end
  1161.  
  1162. if Anim=='Equipped' and LAW.Part1==LA then
  1163.  
  1164. SetWeld(LAW,0,WalkAnim,14,PoseLA,PoseLA2,WPoseLA,WPoseLA2,1)
  1165.  
  1166. SetWeld(RAW,0,WalkAnim,14,PoseRA,PoseRA2,WPoseRA,WPoseRA2,1)
  1167.  
  1168. SetWeld(wHandle,0,WalkAnim,14,PoseHandle,PoseHandle2,WPoseHandle,WPoseHandle2,1)
  1169.  
  1170. end
  1171.  
  1172. local ws=16 for i=1,#WalkSpeed do ws=ws*WalkSpeed[i] end Humanoid.WalkSpeed=ws
  1173.  
  1174. --Trailing Package
  1175.  
  1176. for i,v in pairs(Traili) do
  1177.  
  1178. if Trails[v[1]] then
  1179.  
  1180. local obj,ofs,col,lastofs=v[1],v[2],v[3],v[4]
  1181.  
  1182. local length=(obj.CFrame*ofs.p-lastofs.p).magnitude
  1183.  
  1184. local ob=iPart{Pack,0.5,length,0.5,co=col,tr=0.5,an=true,cf=CFrame.new(obj.CFrame*ofs.p,lastofs.p)}
  1185.  
  1186. iNew{'CylinderMesh',ob}
  1187.  
  1188. Traili[i][4]=ob.CFrame
  1189.  
  1190. ob.CFrame=ob.CFrame*cn(0,0,-length/2)*ca(90,0,0)
  1191.  
  1192. TrailPack[#TrailPack+1]={ob,1,-0.1}
  1193.  
  1194. else
  1195.  
  1196. Traili[i]=nil
  1197.  
  1198. end
  1199.  
  1200. end
  1201.  
  1202. for i,v in pairs(TrailPack) do
  1203.  
  1204. v[2]=v[2]+v[3]
  1205.  
  1206. if v[2]<=0 then
  1207.  
  1208. v[1]:Remove()
  1209.  
  1210. TrailPack[i]=nil
  1211.  
  1212. else
  1213.  
  1214. v[1].Transparency=0.5+(0.45-0.45*v[2])
  1215.  
  1216. v[1].Mesh.Scale=v3(v[2],1,v[2])
  1217.  
  1218. end
  1219.  
  1220. end
  1221.  
  1222. --DoLoop Package
  1223.  
  1224. for i,v in pairs(LoopFunctions) do
  1225.  
  1226. v[2]=v[2]+1
  1227.  
  1228. v[3](v[2]/v[1])
  1229.  
  1230. if v[1]<=v[2] then LoopFunctions[i]=nil end
  1231.  
  1232. end
  1233.  
  1234. HitBox.CFrame=Handle.CFrame*HitBoxCF
  1235.  
  1236. HitBox.Velocity=v3(0,0,0) HitBox.RotVelocity=v3(0,0,0)
  1237.  
  1238. wait()
  1239.  
  1240. end
Add Comment
Please, Sign In to add comment