ChronoShindo

Aot Sword

Jun 22nd, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.54 KB | None | 0 0
  1. v3 = Vector3.new
  2. cn = CFrame.new
  3. ca2 = CFrame.Angles
  4. mf = math.floor
  5. mran = math.random
  6. mrad = math.rad
  7. mdeg = math.deg
  8. ca = function(x,y,z) return ca2(mrad(x),mrad(y),mrad(z)) end
  9. v32=function(x,y,z) return v3(mdeg(x),mdeg(y),mdeg(z)) end
  10. mran2 = function(a,b) return mran(a*1000,b*1000)/1000 end
  11. ud=UDim2.new
  12. bn = BrickColor.new
  13. c3 = Color3.new
  14. nov3=v3(0,0,0)
  15. maxv3=v3(1,1,1)/0
  16. -----
  17. Player = game:service'Players'.LocalPlayer
  18. Char = Player.Character
  19. Torso = Char.Torso
  20. Head = Char.Head
  21. Humanoid = Char.Humanoid
  22. Root=Char.HumanoidRootPart.RootJoint
  23.  
  24. LA=Char['Left Arm']
  25. RA=Char['Right Arm']
  26. LL=Char['Left Leg']
  27. RL=Char['Right Leg']
  28. LAM=Torso:findFirstChild'Left Shoulder' or _G.LAM
  29. RAM=Torso:findFirstChild'Right Shoulder' or _G.RAM
  30. LLM=Torso:findFirstChild'Left Hip' or _G.LLM
  31. RLM=Torso:findFirstChild'Right Hip' or _G.RLM
  32. Neck=Torso.Neck
  33. Neck.C0=cn(0,1.5,0)
  34. Neck.C1=cn(0,0,0)
  35. _G.LAM=LAM _G.RAM=RAM _G.LLM=LLM _G.RLM=RLM
  36.  
  37.  
  38. as,so={},{'metal','Block','Slash','Slash2','Hit','Kick'}
  39. as.corner='11294911'
  40. as.cone='1033714'
  41. as.ring="3270017"
  42. as.Chakram='47260990'
  43. as.ring2='18430887'
  44. as.blast='20329976'
  45. as.missile='10207677'
  46. as.fire='2693346'
  47. as.boom='3264793'
  48. as.slash='10209645'
  49. as.abscond='2767090'
  50. as.firelaser='13775494'
  51. as.diamond='9756362'
  52. as.metal='rbxasset://sounds\\unsheath.wav'
  53. as.Block = 'rbxasset://sounds\\metal.ogg'
  54. as.Slash = '10209645'
  55. as.Slash2 = '46760716'
  56. as.Hit='10209583'
  57. as.Kick='46153268'
  58. as.cast='2101137'
  59.  
  60.  
  61. for i,v in pairs(as) do
  62. if type(tonumber(v:sub(1,3)))=="number" then
  63. as[i]="http://www.roblox.com/asset/?id="..v
  64. end
  65. end
  66.  
  67. game:service"ControllerService":ClearAllChildren()
  68. Controls=Instance.new("HumanoidController",game:service"ControllerService")
  69.  
  70.  
  71. LastMade=nil
  72. iNew=function(tab)
  73. local v=Instance.new(tab[1])
  74. for Ind,Val in pairs(tab) do
  75. if Ind~=1 and Ind~=2 then
  76. v[Ind] = Val
  77. end
  78. end
  79. v.Parent=tab[2]==0 and LastMade or tab[2]
  80. LastMade=v
  81. return v
  82. end
  83. iPart=function(tab)
  84. local v=Instance.new(tab.type or 'Part')
  85. if tab.type~='CornerWedgePart' then v.formFactor='Custom' end
  86. v.TopSurface=0 v.BottomSurface=0
  87. if tab.sc then
  88. v.Size=v3(tab[2]*tab.sc,tab[3]*tab.sc,tab[4]*tab.sc)
  89. else
  90. v.Size=v3(tab[2],tab[3],tab[4])
  91. end
  92. if tab.co then v.BrickColor=bn(tab.co) end
  93. if tab.tr then v.Transparency=tab.tr end
  94. if tab.rf then v.Reflectance=tab.rf end
  95. v.CanCollide=false --if tab.can then v.CanCollide=tab.can end
  96. if tab.cf then v.CFrame=tab.cf end
  97. if tab.an then v.Anchored=tab.an end
  98. if tab.na then v.Name=tab.na end
  99. if tab.ma then v.Material=tab.ma end
  100. v.Parent=tab[1]
  101. v:BreakJoints()
  102. LastMade=v
  103. return v
  104. end
  105. ray = function(Pos, Dir,tab,length) -- ray cast
  106. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *(length or 999)),tab)
  107. end
  108. function getoutline(x,z,i)
  109. return math.sqrt(x^2+z^2)+(i or 0.05),mdeg(math.atan2(x,z))
  110. end
  111. function v3a(cf)
  112. local x,y,z=cf:toEulerAnglesXYZ()
  113. return v3(mdeg(x),mdeg(y),mdeg(z))
  114. end
  115. function TweenV3(i, loops,origpos,nextpos,smooth)
  116. loops=math.floor(loops)
  117. smooth = smooth or 1
  118. local tox2,toy2,toz2 = 0,0,0
  119. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  120. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  121. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  122. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  123. return v3(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)
  124. end
  125. function TweenCF(i, loops,origpos,nextpos,smooth)
  126. loops=math.floor(loops)
  127. smooth = smooth or 1
  128. local x0,y0,z0=origpos:toEulerAnglesXYZ()
  129. local x1,y1,z1=nextpos:toEulerAnglesXYZ()
  130. origangle=v32(x0,y0,z0)
  131. nextangle=v32(x1,y1,z1)
  132. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  133. local tox,toy,toz = 0,0,0
  134. tox = origangle.x > nextangle.x and -math.abs(origangle.x - nextangle.x) *perc or math.abs(origangle.x - nextangle.x) *perc
  135. toy = origangle.y > nextangle.y and -math.abs(origangle.y - nextangle.y) *perc or math.abs(origangle.y - nextangle.y) *perc
  136. toz = origangle.z > nextangle.z and -math.abs(origangle.z - nextangle.z) *perc or math.abs(origangle.z - nextangle.z) *perc
  137. local tox2,toy2,toz2 = 0,0,0
  138. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  139. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  140. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  141. return cn(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  142. end
  143. WeldLib={}
  144. function GetWeld(weld,CO)
  145. if not WeldLib[weld] then
  146. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  147. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  148. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  149. end
  150. return weld['C'..CO].p,WeldLib[weld][CO]
  151. end
  152. function ClearWeld(weld)
  153. if WeldLib[weld] then WeldLib[weld]=nil end
  154. end
  155. function SetWeld(weld,CO,i, loops, origpos,origangle, nextpos,nextangle,smooth)
  156. loops=math.floor(loops)
  157. smooth = smooth or 1
  158. if not WeldLib[weld] then
  159. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  160. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  161. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  162. end
  163. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  164. --print(weld.Part1)
  165. local tox,toy,toz = 0,0,0
  166. tox = origangle.x > nextangle.x and -math.abs(origangle.x - nextangle.x) *perc or math.abs(origangle.x - nextangle.x) *perc
  167. toy = origangle.y > nextangle.y and -math.abs(origangle.y - nextangle.y) *perc or math.abs(origangle.y - nextangle.y) *perc
  168. toz = origangle.z > nextangle.z and -math.abs(origangle.z - nextangle.z) *perc or math.abs(origangle.z - nextangle.z) *perc
  169. local tox2,toy2,toz2 = 0,0,0
  170. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  171. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  172. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  173. WeldLib[weld][CO] = v3(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  174. weld['C'..CO] = cn(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  175. end
  176. function FindSurface(part, position)
  177. local obj = part.CFrame:pointToObjectSpace(position)
  178. local siz = part.Size/2
  179. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  180. local vec = Vector3.FromNormalId(v)
  181. local wvec = part.CFrame:vectorToWorldSpace(vec)
  182. local vz = (obj)/(siz*vec)
  183. if (math.abs(vz.X-1) < 0.01 or math.abs(vz.Y-1) < 0.01 or math.abs(vz.Z-1) < 0.01) then
  184. return wvec,vec
  185. end
  186. end
  187. if part.className == "WedgePart" then
  188. return part.CFrame:vectorToWorldSpace(Vector3.new(0,0.707,-0.707)), Vector3.new(0,0.707,-0.707)
  189. end
  190. end
  191. LoopFunctions={}
  192. function DoLoop(times,func)
  193. LoopFunctions[#LoopFunctions+1]={times,0,func}
  194. end
  195. pcall(function() Torso.LAW:Remove() Torso.RAW:Remove() Torso.LLW:Remove() Torso.RLW:Remove() end)
  196. LAW=iNew{'Weld',Torso,Name='LAW',Part0=Torso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)}
  197. RAW=iNew{'Weld',Torso,Name='RAW',Part0=Torso,C0=cn( 1.5,0.5,0),C1=cn(0,0.5,0)}
  198. LLW=iNew{'Weld',Torso,Name='LLW',Part0=Torso,C0=cn(-0.5, -1,0),C1=cn(0, 1,0)}
  199. RLW=iNew{'Weld',Torso,Name='RLW',Part0=Torso,C0=cn( 0.5, -1,0),C1=cn(0, 1,0)}
  200. function Arms(on)
  201. LAM.Parent=Torso LAM.Part0=Torso
  202. RAM.Parent=Torso RAM.Part0=Torso
  203. LAM.Part1=on and nil or LA
  204. RAM.Part1=on and nil or RA
  205. LAW.Part1=on and LA or nil
  206. RAW.Part1=on and RA or nil
  207. end
  208. function Legs(on)
  209. LLM.Part1=on and nil or LL
  210. RLM.Part1=on and nil or RL
  211. LLW.Part1=on and LL or nil
  212. RLW.Part1=on and RL or nil
  213. end
  214.  
  215. _G.MGear=getfenv()
  216. pcall(function() _G.MGearS.Disabled=true end)
  217. _G.MGearS=script
  218.  
  219. pcall(function() Char.Gear:Remove() end)
  220. Gear=iNew{'Model',Char,Name='Gear'}
  221. Gt={[-1]={},[1]={}}
  222. for x=-1,1,2 do
  223. local base=iPart{Gear,0.6,3,0.8} iNew{'Weld',LastMade,Part0=x==-1 and LL or RL,Part1=LastMade,C0=cn(0.8*x,0.05,0.45)*ca(-80,0,6*x)}
  224. local v=iPart{Gear,0.5,2.5,0.5,co='Lime green'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,-0.24,0.6)} iNew{'CylinderMesh',v}
  225. local v=iPart{Gear,0.5,0.5,0.5,co='Lime green'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.01,0.6)} iNew{'SpecialMesh',v,MeshType='Sphere'}
  226. for z=-1.2,0.81,1 do
  227. local v=iPart{Gear,0.65,0.22,1.35,co='Lime green'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,z,0.22)}
  228. end
  229. local v=iPart{Gear,0.25,0.5,0.25,co='Lime green'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.25,0.6)*ca(0,0,90)} iNew{'CylinderMesh',v}
  230. local v=iPart{Gear,0.3,0.3,0.3,co='Black'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.25,0.6)*ca(0,0,90)} iNew{'CylinderMesh',v}
  231. local st,en=-0.3,0.3 local co=(st*-1+en)/4
  232. for xx=st,en,co do --sheath holes
  233. local v=iPart{Gear,0.2,0.2,0.7,co='Really black'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(xx+co/2,1.5,0)} iNew{'BlockMesh',v,Scale=v3(0.4,0.1,1)}
  234. end
  235. local v=iPart{Gear,0.75,0.2,0.75} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0.6*x,-0.65,1.1)*ca(45,0,-45*x)} iNew{'CylinderMesh',v}
  236. local v=iPart{Gear,0.6,0.22,0.6,co='Lime green'} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0.6*x,-0.65,1.1)*ca(45,0,-45*x)} iNew{'CylinderMesh',v}
  237. local v2=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v2,Part0=v,Part1=v2,C0=cn(0,-0.35,0)*ca(180,0,0)} iNew{'SpecialMesh',v2,Scale=v3(0.3,0.65,0.3),MeshId=as.cone}
  238. local v2=iPart{Gear,0.2,0.2,0.3} iNew{'Weld',v2,Part0=v,Part1=v2,C0=ca(0,200*x,0)*cn(0,0,-0.5)}
  239. --sword handle
  240. local h=iPart{Gear,0.3,1.05,0.3} local hw=iNew{'Weld',h,Part0=x==-1 and LA or RA,Part1=h,C0=cn(0,-1,0)*ca(-90,0,0)} iNew{'CylinderMesh',h}
  241. Gt[x].h=hw
  242. local v=iPart{Gear,0.32,0.2,0.32,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,-0.35,0)} iNew{'CylinderMesh',v}
  243. local v=iPart{Gear,0.2,0.5,0.25} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25,-0.15)}
  244. local v=iPart{Gear,0.21,0.2,0.25,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25+0.12,-0.125)}
  245. local v=iPart{Gear,0.21,0.2,0.25,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25-0.12,-0.125)}
  246. local v=iPart{Gear,0.3,0.2,0.3} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6,0)}
  247. local v=iPart{Gear,0.3,0.2,0.3,type='WedgePart'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6,-0.3)}
  248. local v=iPart{Gear,0.3,0.2,0.3,type='WedgePart'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6, 0.3)*ca(180,0,0)}
  249. local v=iPart{Gear,0.2,0.5,0.2} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0, 0.3,-0.4)*ca( 14,0,0)} iNew{'CylinderMesh',v,Scale=v3(0.6,1,0.6)}
  250. local v=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,-0.25,-0.35)*ca(-20+180,0,0)} iNew{'SpecialMesh',v,MeshId=as.cone,Scale=v3(0.06,1,0.06)}
  251. --sword blade
  252. local bladelength=4
  253. local blade=iPart{Gear,0.2,bladelength,0.4} iNew{'Weld',v,Part0=h,Part1=blade,C0=cn(0,0.7+bladelength/2,0.05)} iNew{'BlockMesh',blade,Scale=v3(0.4,1,1)}
  254. local tip=iPart{Gear,0.2,0.5,0.4,type='WedgePart'} iNew{'Weld',v,Part0=blade,Part1=tip,C0=cn(0,bladelength/2+0.25,0)*ca(0,180,0)} iNew{'SpecialMesh',tip,MeshType='Wedge',Scale=v3(0.4,1,1)}
  255. for i=-1.6,1.4,0.6 do
  256. local v=iPart{Gear,0.2,0,0.52,co='Lime green'} iNew{'Weld',v,Part0=blade,Part1=v,C0=cn(0,i+0.1,0)*ca(40,0,0)} iNew{'BlockMesh',v,Scale=v3(0.42,0.3,1)}
  257. end
  258.  
  259. end
  260. --Middle
  261. local v=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-1,1.1)*ca(90,0,0)} iNew{'SpecialMesh',v,Scale=v3(0.4,1.6,0.16),MeshId=as.cone}
  262. Gas=iNew{'Smoke',v,Opacity=0.4,RiseVelocity=25,Size=3,Enabled=false}
  263. local v=iPart{Gear,0.6,0.3,0.6} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-0.85,0.8)} iNew{'CylinderMesh',v}
  264. local v=iPart{Gear,0.3,0.3,0.35,co='Lime green',type='WedgePart'} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-0.9,1.2)*ca(0,180,0)}
  265. local belt=iPart{Gear,2.01,0.3,1.01,co='Black'} iNew{'Weld',belt,Part0=Torso,Part1=belt,C0=cn(0,-0.7,0)}
  266. for x=-1,1,2 do --continuesides
  267. local of=iPart{Gear,0.3,1.2,0.3} iNew{'Weld',belt,Part0=belt,Part1=of,C0=cn(1.15*x,-0.1,0)*ca(-80,0,0)}
  268. local v=iPart{Gear,0.3,1.2,0.3} iNew{'Weld',v,Part0=of,Part1=v,C0=cn(0,0,0.15)} iNew{'CylinderMesh',v}
  269. local v=iPart{Gear,0.2,0.2,0.2,co='Really black'} iNew{'Weld',v,Part0=of,Part1=v,C0=cn(0,0.51,0.15)} iNew{'CylinderMesh',v}
  270. Gt[x].grap=v
  271.  
  272. end
  273.  
  274. for i,v in pairs(Torso:children()) do
  275. if v:IsA'Sound' then v:Remove() end
  276. end
  277. for i,n in pairs(so) do
  278. if as[n] then
  279. local v=iNew{'Sound',Torso,Volume=0.5,Pitch=1,Looped=false,Name=n,SoundId=as[n]}
  280. so[n]=v
  281. end
  282. end
  283.  
  284.  
  285. key={}
  286.  
  287. print(#Gear:children())
  288. Root.C0=cn(0,0,0)*ca(0,0,0)
  289. Root.C1=cn(0,0,0)*ca(0,0,0)
  290.  
  291. WalkAnim=0
  292. Walking=false
  293. WalkM=8
  294. Humanoid.Running:connect(function(Walk)
  295. Walking=Walk>20 and true or false
  296. end)
  297.  
  298. --LL.Touched:connect(function() if Torso.Velocity.magnitude>30 then Torso.Velocity=nov3 end end)
  299. --RL.Touched:connect(function() if Torso.Velocity.magnitude>30 then Torso.Velocity=nov3 end end)
  300. _G.Torso=Torso
  301.  
  302. wait()
  303. Arms(true)
  304. Legs()
  305. GetCurrent=function()
  306. cLA,cLA2=GetWeld(LAW,0)
  307. cRA,cRA2=GetWeld(RAW,0)
  308. cLL,cLL2=GetWeld(LLW,0)
  309. cRL,cRL2=GetWeld(RLW,0)
  310. cRO,cRO2=GetWeld(Root,0)
  311. cNE,cNE2=GetWeld(Neck,0)
  312. end
  313. ReturnAnim=function()
  314. GetCurrent()
  315. local ogt={[-1]={},[1]={}}
  316. for x=-1,1,2 do ogt[x][1],ogt[x][2]=GetWeld(Gt[x].h,0) end
  317. local walk=WalkAnim~=0
  318. for x=1,ASpeed do
  319. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA,walk and Walk1*WAPerc or OrigLA2,1)
  320. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA,walk and Walk2*WAPerc or OrigRA2,1)
  321. if Hooks[-1] or Hooks[1] then else
  322. SetWeld(LLW,0,x,ASpeed,cLL,cLL2,OrigLL,OrigLL2,1)
  323. SetWeld(RLW,0,x,ASpeed,cRL,cRL2,OrigRL,OrigRL2,1) end
  324. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,walk and Walk3*WAPerc or OrigRO2,1)
  325. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,walk and Walk4*WAPerc or OrigNE2,1)
  326. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed,ogt[h][1],ogt[h][2],v3(0,-1,0),v3(-90,0,0),1) end
  327. wait()
  328. end
  329. end
  330.  
  331. SpecialAttack=function(TYPE)
  332. if TYPE==1 then
  333. GetCurrent()
  334. if Controls.Parent then Humanoid.Jump=true end
  335. local legwas=LLW.Part1==LL and true or false
  336. Legs(true)
  337. for x=1,ASpeed/2 do
  338. SetWeld(LAW,0,x,ASpeed/2,cLA,cLA2,OrigLA+v3(0,0.8,-0.2),v3(190,0, 10,1),1)
  339. SetWeld(RAW,0,x,ASpeed/2,cRA,cRA2,OrigRA+v3(0,0.8,-0.2),v3(190,0,-10,1),1)
  340. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed/2,v3(0,-1,0),v3(-90,0,0),v3(0,-1.25,0),v3(-135,0,0),1) end
  341. SetWeld(LLW,0,x,ASpeed/2,cLL,cLL2,OrigLL+v3(0,0.6,-0.7),v3(-30,0,-10,1),1)
  342. SetWeld(RLW,0,x,ASpeed/2,cRL,cRL2,OrigRL+v3(0,0.6,-0.7),v3(-30,0,10,1),1)
  343. SetWeld(Root,0,x,ASpeed/2,cRO,cRO2,OrigRO,v3(90,0,0,1),1)
  344. wait()
  345. end
  346. local spin,ii=360,3
  347. for i=0,spin,spin/12 do
  348. ii=ii+1 if ii%4==0 then so.Slash:Play() end
  349. Root.C0=ca(90-i,0,0)
  350. wait()
  351. end
  352. ClearWeld(Root)
  353. ReturnAnim() Legs(legwas)
  354. elseif TYPE==2 then
  355. end
  356. end
  357.  
  358. pcall(function() Torso.BG:Remove() Torso.RP:Remove() end)
  359. BG=iNew{'BodyGyro',Torso,Name='BG',maxTorque=nov3}
  360. BP=iNew{'RocketPropulsion',Torso,Name='RP'}
  361. local rocketprop=iPart{Gear,1,1,1,an=true,cf=cn(0,-100,0),tr=1}
  362. rocketprop.CanCollide=false
  363. BP.Target=rocketprop
  364. BP.ThrustP=5
  365. BP.MaxTorque=nov3 --v3(400000,400000,0)
  366. BP.MaxThrust=4000
  367. BP.MaxSpeed=30
  368. --BP.CartoonFactor=1
  369. BP.TurnP,BP.TurnD=0,0
  370. BP.ThrustD=0.03 --BP.ThrustD*30
  371. BP.ThrustP=BP.ThrustP/1.5
  372. BP.TargetRadius=0
  373.  
  374. pcall(function() workspace.Camera.Inv:Remove() end)
  375. Inv=iNew{'Model',workspace.Camera,Name='Inv'}
  376.  
  377. Hooks={}
  378. HookP={[-1]={},[1]={}}
  379. Hit=nil
  380. Grapple={}
  381. key={}
  382. mouse=Player:GetMouse()
  383. mouse.KeyDown:connect(function(k)
  384. coroutine.resume(coroutine.create(function()
  385. key[k]=true
  386. local gp={['q']=-1,['e']=1}
  387. if k=='2' then
  388. elseif (k==' ') and Controls.Parent==nil then
  389. if WallWalk then WallWalk=false return end
  390. WallWalk=false
  391. Controls.Parent=game:service'ControllerService'
  392. Humanoid.Sit=false
  393. Legs(false)
  394. OrigRO=v3(0,0,0)
  395. Root.C0=cn(OrigRO)
  396. ---
  397. elseif k=='0' and Controls.Parent==nil and not Gas.Enabled and not WallWalking then
  398. local bv=iNew{'BodyVelocity',Torso}
  399. Gas.Enabled=true
  400. repeat
  401. local ss=(Hooks[1] or Hooks[-1]) and 5000 or 2000
  402. bv.maxForce=v3(ss,2000,ss)
  403. bv.velocity=Torso.CFrame.lookVector*125
  404. wait()
  405. until not key[k] or Controls.Parent
  406. Gas.Enabled=false
  407. bv:Remove()
  408. elseif (k=='q' or k=='e') and not Grapple[k] then
  409. so.Slash:Play()
  410. Grapple[k]=true
  411. local x=gp[k]
  412. local ob1=Gt[x].grap
  413. local speed=26
  414. local hook=iPart{Gear,1,1,1,co='Black',an=true,cf=cn(ob1.Position,mouse.Hit.p)*ca(-90,0,0)} iNew{'SpecialMesh',hook,Scale=v3(0.4,2,0.4),MeshId=as.cone}
  415. local rope=iPart{Gear,1,1,1,co='Black',an=true,cf=cf} local ropem=iNew{'CylinderMesh',rope}
  416. hook.CanCollide=false
  417. rope.CanCollide=false
  418. local con=game:GetService'RunService'.RenderStepped:connect(function()
  419. local mag=(ob1.Position-hook.Position).magnitude
  420. ropem.Scale=v3(0.2,mag,0.2)
  421. rope.CFrame=cn(ob1.Position,hook.Position)*cn(0,0,-mag/2)*ca(90,0,0)
  422. if not rope or not rope.Parent then con:disconnect() end
  423. end)
  424. for i=1,200 do
  425. if not key[k] then break end
  426. local hit,pos=ray(hook.Position,hook.Position-hook.CFrame*cn(0,-speed,0).p,Char,speed+1)
  427. if not hit then
  428. hook.CFrame=hook.CFrame*cn(0,speed,0)*ca(-0.1,0,0)
  429. else
  430. hook.CFrame=hook.CFrame*cn(0,(hook.Position-pos).magnitude,0)
  431. end
  432. local mag=(ob1.Position-hook.Position).magnitude
  433. if hit and hit.Transparency<1 and hit.CanCollide then
  434. Hit=hit
  435. HookP[x]={Hit,Hit.CFrame:toObjectSpace(hook.CFrame),pos}
  436. so.Block:Play()
  437. Hooks[x]=hook
  438. Humanoid.Sit=true
  439. Legs(true)
  440. OrigRO=v3(0,1,0)
  441. Root.C0=cn(OrigRO)
  442. Controls.Parent=nil
  443. break
  444. end
  445. wait()
  446. end
  447. ---
  448. if Hit then
  449. --hook.Reflectance=0.1
  450. end
  451. repeat wait()
  452. until not key[k] or Controls.Parent --relase
  453. Hooks[x]=nil
  454. hook:Remove()
  455. rope:Remove()
  456. Grapple[k]=false
  457. elseif k=='f' and LegAnim=='None' and TorsoAnim=='None' and LegAnim=='None' then
  458. ArmAnim,LegAnim,TorsoAnim='','',''
  459. SpecialAttack(1)
  460. ArmAnim,LegAnim,TorsoAnim='None','None','None'
  461. elseif k=='p' then
  462. local mpos=mouse.Hit.p
  463. local wall=iPart{Char,1,1,1,an=true}
  464. repeat
  465. local mag=(mpos-mouse.Hit.p).magnitude
  466. wall.Size=v3(not key.l and 4 or 0.5,200,mag)
  467. wall.CFrame=cn(mpos,mouse.Hit.p)*cn(0,100,-mag/2)
  468. wait() until not key.p
  469. local cf=wall.CFrame wall.Parent=workspace wall.CFrame=cf wall.CanCollide=true
  470. elseif k=='l' then
  471. wotm8=wotm8 and wotm8+150 or 75
  472. iPart{workspace,120,30,120,an=true,cf=cn(0,180,wotm8+100)*ca(0,mran(-40,40),0)}.CanCollide=true
  473. iPart{workspace,146,4,120,an=true,cf=cn(0,1,wotm8+100)}.CanCollide=true
  474. --elseif k=='w' and (not Hooks[-1] and not Hooks[1]) then
  475. --Humanoid.PlatformStand=false
  476. end
  477. end)) end)
  478. mouse.KeyUp:connect(function(k)
  479. coroutine.resume(coroutine.create(function()
  480. key[k]=false
  481.  
  482. end)) end)
  483. mouse.Button1Down:connect(function()
  484. Button1=true
  485. if ArmAnim=='None' then
  486. ArmAnim,TorsoAnim='Attack','Attack'
  487. thesteerclick=thesteerclick==1 and -1 or 1
  488. local y=thesteerclick
  489. GetCurrent()
  490. local ASpeed=ASpeed/1.5
  491. for x=1,ASpeed do
  492. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA,v3(0,-135*y,(-90-LookAngle/2)*y),1)
  493. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA,v3(0,-135*y,(-90-LookAngle/2)*y),1)
  494. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,v3(0,-90*y,0),1)
  495. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,v3(0,90*y/3,0),1)
  496. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed,v3(0,-1,0),v3(-90,0,0),v3(0,-1.25,0),v3(-180,0,0),1) end
  497. wait()
  498. end
  499. GetCurrent()
  500. so.Slash:Play()
  501. for x=1,ASpeed do
  502. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA+v3(0,0,-0.8),v3(0,-30*y,(-90-LookAngle/2)*y),1)
  503. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA+v3(0,0,-0.8),v3(0,-30*y,(-90-LookAngle/2)*y),1)
  504. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,v3(0,80*y,0),1)
  505. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,v3(0,-80*y/3,0),1)
  506. wait()
  507. end
  508. ReturnAnim()
  509. ArmAnim,TorsoAnim='None','None'
  510. end
  511. end)
  512. mouse.Button1Up:connect(function()
  513. Button1=false
  514.  
  515. end)
  516.  
  517.  
  518. LegAnim='None'
  519. ArmAnim='None'
  520. TorsoAnim='None'
  521. WalkSpeed={1,1,1,1,1,1,1,1}
  522. ASpeed=8
  523. OrigLA=v3(-1.5,0.5,0) OrigLA2=v3(5,0,-30)
  524. OrigRA=v3( 1.5,0.5,0) OrigRA2=v3(5,0,30)
  525. OrigLL=v3(-0.5,-1,0) OrigLL2=v3(0,0,0)
  526. OrigRL=v3( 0.5,-1,0) OrigRL2=v3(0,0,0)
  527. OrigRO=v3(0,0,0) OrigRO2=v3(0,0,0)
  528. OrigNE=v3(0,1.5,0) OrigNE2=v3(0,0,0)
  529. -----
  530. --c/local x,y,z=workspace.RobroxMasterDX.Torso["Left Hip"].C0:toEulerAnglesXYZ() print(math.deg(y))
  531. rocketfired=false
  532. local spi,spix,span=0,0.5,1
  533. while Gear.Parent do
  534. local headpos,mousepos=Head.Position,mouse.Hit.p
  535. XAngle=math.floor(cn(headpos,mousepos).lookVector.y*180)
  536. LookAngle=XAngle<-20 and -20 or (XAngle>45 and 45 or XAngle)
  537. WalkAnim=WalkAnim+(ArmAnim=='None' and (Walking and 1 or -1) or 0)
  538. if WalkAnim<0 then WalkAnim=0 elseif WalkAnim>WalkM then WalkAnim=WalkM end
  539. WAPerc=WalkAnim/WalkM
  540. spi=spi+spix
  541. local adj=spi*8
  542. if math.abs(spi)>=span then spix=spix*-1 end
  543. Walk1,Walk2,Walk3,Walk4=v3(0,90,-90+25+adj),v3(0,-90,90-25-adj),v3(-18-adj,0,spi*1.5),v3(18+adj,0,-spi*1.5)
  544. if ArmAnim=='None' then
  545. SetWeld(LAW,0,WalkAnim,WalkM,OrigLA,OrigLA2,OrigLA,Walk1,1)
  546. SetWeld(RAW,0,WalkAnim,WalkM,OrigRA,OrigRA2,OrigRA,Walk2,1)
  547. end
  548. if TorsoAnim=='None' then
  549. SetWeld(Root,0,WalkAnim,WalkM,OrigRO,OrigRO2,OrigRO,Walk3,1)
  550. SetWeld(Neck,0,WalkAnim,WalkM,OrigNE,OrigNE2,OrigNE,Walk4,1)
  551. end
  552. local ws=28 for i=1,#WalkSpeed do ws=ws*WalkSpeed[i] end Humanoid.WalkSpeed=ws
  553. --DoLoop Package
  554. for i,v in pairs(LoopFunctions) do
  555. v[2]=v[2]+1
  556. v[3](v[2]/v[1])
  557. if v[1]<=v[2] then LoopFunctions[i]=nil end
  558. end
  559. for x=-1,1,2 do
  560. if Hooks[x] then Hooks[x].CFrame=HookP[x][1].CFrame*HookP[x][2] end
  561. end
  562. if Hooks[-1] or Hooks[1] then
  563. local hook=(Hooks[1] and Hooks[-1]) and 0 or Hooks[1] or Hooks[-1]
  564. HookPos=hook==0 and Hooks[1].Position+(Hooks[-1].Position-Hooks[1].Position)/2 or hook.CFrame.p
  565. BP.MaxTorque=v3(0,0,0) BP.MaxSpeed=200 BP.MaxThrust=10*10000
  566. rocketprop.CFrame=cn(HookPos+v3(0,4,0))
  567. if not rocketfired then BP:Fire() rocketfired=true end
  568. else BP.MaxTorque=nov3
  569. if rocketfired then BP:Abort() rocketfired=false end
  570. end
  571. if Humanoid.Sit and not WallWalking then
  572. SetWeld(LLW,0,1,1,OrigLL,OrigLL2,OrigLL+v3(0,0.6,-0.7),v3(-30,0,-14,1),1)
  573. SetWeld(RLW,0,1,1,OrigRL,OrigRL2,OrigRL+v3(0,0.6,-0.7),v3(-30,0, 14,1),1)
  574. if not WallWalking then BG.cframe=cn(Torso.Position,mouse.Hit.p)*cn(0,0,-1) end --TweenCF(3,9,bg.CFrame,cn(Torso.Position,mouse.Hit.p))*cn(0,0,-1)
  575. BG.maxTorque=maxv3 --workspace.Camera.CoordinateFrame*cn(0,0,-1000).p
  576. else
  577. if not WallWalking then BG.maxTorque=nov3 end
  578. end
  579. wait()
  580. end --TweenV3(0.5,1,Hooks[1].Position,Hooks[-1].Position)
Add Comment
Please, Sign In to add comment