ChronoShindo

3d Manuever Gear

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