Laksana

Untitled

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