Advertisement
good_scripter

Untitled

May 30th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.06 KB | None | 0 0
  1. Players = game:service'Players'
  2. Debris = game:service'Debris'
  3.  
  4. CF = CFrame.new
  5. CFa = CFrame.Angles
  6. CFA = function(x,y,z) return CFa(MR(x),MR(y),MR(z)) end
  7. V3 = Vector3.new
  8. MR = math.rad
  9. MD = math.deg
  10. MRND = math.random
  11. CFN=CF(0,0,0)
  12. V3N=V3(0,0,0)
  13. V3M=V3(1/0,1/0,1/0)
  14.  
  15.  
  16. newI = function(tab)
  17. local p = Instance.new(tab[1],tab[2])
  18. for i,v in pairs(tab) do
  19. if i=="Debris" then
  20. Debris:AddItem(p,v)
  21. elseif (i~=1 and i~=2) then
  22. p[i] = v
  23. end
  24. end
  25. return p
  26. end
  27.  
  28. ------------Assets
  29. assets = {}
  30. --Meshes
  31. assets.Ring = "3270017"
  32. assets.Bullet1 = "10207677"
  33. assets.MuzzleFlash = "25212400"
  34. --MeshTexture
  35.  
  36. --Decals
  37.  
  38. --Gui Decals
  39.  
  40. --Sounds
  41. assets.Minigun1 = "2766581"
  42. assets.Fire1 = "2760979"
  43. --
  44. assetprefix = "http://www.roblox.com/asset/?id="
  45. for i,v in pairs(assets) do
  46. if v:sub(1,3)~="htt" and v:sub(1,3)~="rbx" then
  47. assets[i]=assetprefix..v
  48. end
  49. end
  50. ----------------------------
  51. PlaySound=function(soundId,Parent,Pit,Vol)
  52. local v=newI{"Sound",Parent,SoundId=soundId,Volume=Vol,Pitch=Pit,Looped=false,Debris=5}
  53. v:Play()
  54. end
  55.  
  56. newPart = function(sizea,sizeb,sizec,parent,cframe,aa,bb,cc,dd,ee,ff)
  57. local Materials = {}
  58. for i,v in pairs{
  59. "Plastic","SmoothPlastic","Wood", "WoodPlanks",
  60. "Marble", "Slate","Concrete", "Granite",
  61. "Brick","Pebble", "Cobblestone","CorrodedMetal",
  62. "DiamondPlate", "Foil", "Metal","Grass",
  63. "Sand","Fabric","Ice","Neon"} do
  64. Materials[v]=v
  65. end
  66. local mat,col
  67. local part = Instance.new("Part",parent or Model)
  68. for i,v in pairs{aa,bb,cc,dd,ee,ff} do
  69. if Materials[v] then mat=v end
  70. if BrickColor.new(v).Name==v then col=v end
  71. if v=="CylinderMesh" or v=="BlockMesh" then local m = Instance.new(v,part) m.Name="Mesh" end
  72. if v=="Torso" then newI{"SpecialMesh",part,MeshType="Torso"} end
  73. if v=="Sphere" then newI{"SpecialMesh",part,MeshType="Sphere"} end
  74. if v=="Wedge" then part:Destroy() part=Instance.new("WedgePart",parent or Model) end
  75. if v=="Corner" then part:Destroy() part=Instance.new("CornerWedgePart",parent or Model) end
  76. if v=="Ring" then newI{"SpecialMesh",part,MeshType="FileMesh",MeshId=assets.Ring} end
  77. if v=="nonCollide" then part.CanCollide=false end
  78. if v=="Transparent" then part.Transparency=1 end
  79. if v=="Anchored" then part.Anchored=true end
  80. if v=="S0.5" then sizea=sizea/2 sizeb=sizeb/2 sizec=sizec/2 part.Mesh.Scale=part.Mesh.Scale*2 end
  81. end
  82. if part.className~="CornerWedgePart" then part.formFactor="Custom" end
  83. for i,v in pairs{"Top","Bottom","Left","Right","Front","Back"} do
  84. part[v.."Surface"]="SmoothNoOutlines"
  85. end
  86. part.Size=V3(sizea,sizeb,sizec) or V3(1,1,1)
  87. part.CFrame=cframe or CF(0,-50,0)
  88. part.BrickColor=BrickColor.new(col or '')
  89. part.Material = mat or 'SmoothPlastic'
  90. part:BreakJoints()
  91. part.Elasticity = 0
  92. part.Name="z"
  93. part.CustomPhysicalProperties = PhysicalProperties.new(2,2,0,2,0)
  94. return part,cframe
  95. end
  96.  
  97. newMesh=function(parent,dtype,sx,sy,sz)
  98. local filemesh
  99. local mesh
  100. if dtype=="Block" or dtype=="Cylinder" then
  101. mesh=INEW(types.."Mesh",parent)
  102. elseif dtype:sub(1,4)=="http" or dtype:sub(1,3)=="rbx" then
  103. mesh=INEW("SpecialMesh",parent)
  104. mesh.MeshType="FileMesh"
  105. mesh.MeshId=dtype
  106. filemesh=true
  107. else
  108. mesh=INEW("SpecialMesh",parent)
  109. mesh.MeshType=dtype
  110. end
  111. if parent.Size.x<=0.2 then parent.CanCollide=false end
  112. local yes=parent.Size.x<0.2001 and 5 or 1
  113. if filemesh then yes=1 end
  114. mesh.Scale=V3(sx or 1,sy or 1,sz or 1)*yes
  115. return mesh
  116. end
  117.  
  118. newWeld = function(parent,P0,P1,C0,C1)
  119. local weld=Instance.new("Weld",parent or P0)
  120. weld.Part0=P0
  121. weld.Part1=P1
  122. weld.C0=C0 or weld.C0
  123. weld.C1=C1 or weld.C1
  124. return weld
  125. end
  126. newWeld6D = function(parent,P0,P1,C0,C1)
  127. local weld=Instance.new("Motor6D",parent or P0)
  128. weld.Part0=P0
  129. weld.Part1=P1
  130. weld.C0=C0 or weld.C0
  131. weld.C1=C1 or weld.C1
  132. return weld
  133. end
  134.  
  135. ray = function(Origin,Direction,tab,length) -- ray cast
  136. return workspace:FindPartOnRay(Ray.new(Origin,Direction.unit *(length or 999)),tab)
  137. end
  138. addProjectile = function(Origin,Destination,Speed,onHit,extra,noHit)
  139. local current = CF(Origin,Destination.p)
  140. local co = 0
  141. doIn(4,function(i,wkey,step)
  142. co=co+1
  143. if co%2==0 then
  144. local Speed2 = Speed*step
  145. local Hit,Pos = ray(current.p,Destination.p-Origin,mech,Speed2)
  146. if Hit then
  147. current=current*CF(0,0,-(current.p-Pos).magnitude)
  148. doInT[wkey] = nil
  149. onHit(Hit)
  150. else
  151. current=current*CF(0,0,-Speed2)
  152. end
  153. extra(current,i*4)
  154. end
  155. end,function()
  156. if noHit and noHit~=0 then
  157. noHit()
  158. end
  159. end)
  160. end
  161.  
  162. checkCF = function(weld)
  163. local x,y,z = weld.C0:toEulerAnglesXYZ()
  164. print(weld.Name ..".C0 ",weld.C0.x,weld.C0.y,weld.C0.z," ",MD(x),MD(y),MD(z))
  165. local x,y,z = weld.C1:toEulerAnglesXYZ()
  166. print(weld.Name ..".C1 ",weld.C1.x,weld.C1.y,weld.C1.z," ",MD(x),MD(y),MD(z))
  167. end
  168.  
  169. GetX = function(Part,Point)
  170. local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ()
  171. return math.deg(x)
  172. end
  173. GetY = function(Part,Point)
  174. local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ()
  175. return math.deg(y)
  176. end
  177.  
  178. getTriangleValues = function(Points)
  179. local G, V = 0
  180. for S = 1, 3 do
  181. local L = (Points[1+(S+1)%3]-Points[1+S%3]).magnitude
  182. G, V = L > G and L or G, L > G and {Points[1+(S-1)%3], Points[1+(S)%3], Points[1+(S+1)%3]} or V
  183. end
  184. local D = V[2]+(V[3]-V[2]).unit*((V[3]-V[2]).unit:Dot(V[1]-V[2]))
  185. local C, B = (D-V[1]).unit, (V[2]-V[3]).unit
  186. local A = B:Cross(C)
  187. S1 = V3(0.2, (V[2]-D).magnitude, (V[1]-D).magnitude)/1 --0.2
  188. S2 = V3(0.2, (V[3]-D).magnitude, (V[1]-D).magnitude)/1 --0.2
  189. C1 = CF(0,0,0,A.X,B.X,C.X,A.Y,B.Y,C.Y,A.Z,B.Z,C.Z)+(V[1]+V[2])/2
  190. C2 = CF(0,0,0,-A.X,-B.X,C.X,-A.Y,-B.Y,C.Y,-A.Z,-B.Z,C.Z)+(V[1]+V[3])/2
  191. return C1, C2, S1, S2
  192. end
  193.  
  194. fillTriangle = function(...)
  195. local C1,C2,S1,S2 = getTriangleValues(...)
  196. local tri1 = newPart(S1.x,S1.y,S1.z,mech,C1,"Wedge")
  197. local tri2 = newPart(S2.x,S2.y,S2.z,mech,C2,"Wedge")
  198. --for i=1,3 do
  199. --newPart(0.4,0.4,0.4,mech,CF((...)[i]),"nonCollide","Really black","Anchored")
  200. --end
  201. return tri1,tri2
  202. end
  203.  
  204.  
  205.  
  206. n = ""
  207.  
  208. ThighAngle = -40
  209. LegAngle = 135
  210. FootAngle = -40
  211. ToeAngle = -LegAngle-ThighAngle-FootAngle
  212.  
  213. ThighAngle = -25
  214. LegAngle = 75
  215. FootAngle = 10
  216. ToeAngle = -LegAngle-ThighAngle-FootAngle
  217.  
  218. --SCROP SCROP SCROP SCROP SCROP SCROP SCROP SCROP SCROP SCROP SCROP
  219. pcall(function() workspace["RM Mech 2"]:Remove() end)
  220. mech = newI{"Model",workspace,Name="RM Mech 2"}
  221.  
  222. Base = newPart(10,10,8,mech,CF(0,50,0),"nonCollide")
  223. Base.Transparency=1
  224. Torso = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent")
  225. BaseW = newWeld6D(Base,Base,Torso,CF(0,0,0)*CFA(0,0,0))
  226. Torso1 = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent") --for X Turn
  227. Torso1W = newWeld6D(Torso,Torso,Torso1,CF(0,0,0)*CFA(0,0,0))
  228. Torso2 = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent") --for Y Turning Torso
  229. Torso2W = newWeld6D(Torso1,Torso1,Torso2,CF(0,0,0)*CFA(0,0,0))
  230.  
  231.  
  232. --[[
  233. Stand = newPart(2,2,2,mech,Base.CFrame,"Transparent") --Stand (motor6d never used)
  234. Stand.Name = "Left Leg"
  235. StandW = newWeld6D(Base,Base,Stand,CF(-4.5,-7-0.172-6,0))
  236. Stand = newPart(2,2,2,mech,Base.CFrame,"Transparent")
  237. Stand.Name = "Right Leg"
  238. StandW = newWeld6D(Base,Base,Stand,CF( 4.5,-7-0.172-6,0)) --]]
  239.  
  240. ------------------
  241. fillTriangle1Mech = function(...)
  242. local t1,t2 = fillTriangle(...)
  243. newWeld(Torso,Torso2,t1,Torso2.CFrame:toObjectSpace(t1.CFrame))
  244. newWeld(Torso,Torso2,t2,Torso2.CFrame:toObjectSpace(t2.CFrame))
  245. return t1,t2
  246. end
  247.  
  248. ------------------
  249. LThigh = newPart(3,3,3,mech,Torso.CFrame,"nonCollide","Transparent")
  250. LThighW = newWeld6D(Torso,Torso,LThigh,CF(-4.5+1.5,0,0),CF( 1.5,0.5,0)*CFA(ThighAngle,0,0))
  251. RThigh = newPart(3,3,3,mech,Torso.CFrame,"nonCollide","Transparent")
  252. RThighW = newWeld6D(Torso,Torso,RThigh,CF( 4.5-1.5,0,0),CF(-1.5,0.5,0)*CFA(ThighAngle,0,0))
  253. for i,v in pairs{[-1]=LThigh,[1]=RThigh} do
  254. newWeld(Torso,v,newPart(2.2,0.4,2.2,mech,nil,"CylinderMesh","nonCollide","Dark stone grey"),CF(1.41*i,0.5,0)*CFA(0,0,90))
  255. newWeld(Torso,v,newPart(1.8,0.41,1.8,mech,nil,"CylinderMesh","nonCollide","Black"),CF(1.41*i,0.5,0)*CFA(0,0,90))
  256. newWeld(Torso,v,newPart(1.75,0.2,1.75,mech,nil,"CylinderMesh","nonCollide","Really black"),CF(1.41*-i,0.5,0)*CFA(0,0,90))
  257.  
  258. newWeld(Torso,v,newPart(1.4,3.2,1.4,mech,nil,"CylinderMesh","nonCollide","Dark stone grey"),CF(0,-5,0)*CFA(0,0,90))
  259. newWeld(Torso,v,newPart(1.1,3.3,1.1,mech,nil,"CylinderMesh","nonCollide","Black"),CF(0,-5,0)*CFA(0,0,90))
  260. newWeld(Torso,v,newPart(1.6,0.2,1.2,mech,nil),CF(0,-3.9,-0.1))
  261.  
  262. local newp = newPart(1.6,math.sqrt(1+5.5*5.5)+0.05,0.2,mech,nil)
  263. local newpw = newWeld(Torso,v,newp,CF(0,-1.25,1.4-0.52)*CFA(math.deg(math.tan(1/5.5)),0,0))
  264. if i==-1 then
  265. LThighPad = newp
  266. LThighPadW = newpw
  267. else
  268. RThighPad = newp
  269. RThighPadW = newpw
  270. end
  271. local newp = newPart(1.6,math.sqrt(0.2^2+5.5^2)+0.05,0.2,mech,nil)
  272. local newpw = newWeld(Torso,v,newp,CF(0,-1.25,-1.4+0.3)*CFA(-math.deg(math.tan(0.6/5.5)),0,0)*CF(0,2.7725,0),CF(0,2.7725,0)*CFA(0,0,0))
  273. if i==-1 then
  274. LThighPad2 = newp
  275. LThighPad2W = newpw
  276. else
  277. RThighPad2 = newp
  278. RThighPad2W = newpw
  279. end
  280.  
  281. newWeld(Torso,v,newPart(3,1.2,0.8,mech,nil,"Wedge"),CF(0,2.1,-1.5+0.4)*CFA(0,0,0))
  282. newWeld(Torso,v,newPart(3,1.2,0.6,mech,nil),CF(0,2.1,-1.5+1.1))
  283. newWeld(Torso,v,newPart(3,1.2,1.6,mech,nil,"Wedge"),CF(0,2.1, 1.5-0.8)*CFA(0,180,0))
  284. for i=-1,1,2 do
  285. newWeld(Torso,v,newPart(0.7,7.5,1.6,mech,nil),CF(-1.15*i,-2.25,0))
  286. newWeld(Torso,v,newPart(0.7,0.8,0.5,mech,nil,"Wedge"),CF(1.15*i,-6.25,-0.4)*CFA(-90,0,0))
  287. newWeld(Torso,v,newPart(0.7,0.8,0.5,mech,nil,"Wedge"),CF(1.15*i,-6.25, 0.4)*CFA(-90,0,180))
  288. newWeld(Torso,v,newPart(0.7,0.7,7.5,mech,nil,"Wedge"),CF(1.15*i,-2.25,-0.8-0.35)*CFA(-90,0,0))
  289. newWeld(Torso,v,newPart(0.7,0.7,7.5,mech,nil,"Wedge"),CF(1.15*i,-2.25, 0.8+0.35)*CFA(-90,0,180))
  290. end
  291. end
  292. LLeg = newPart(2,2,2,mech,Torso.CFrame,"Transparent","nonCollide")
  293. LLegW = newWeld6D(LThigh,LThigh,LLeg,CF(0,-5,0),CF(0,0,0)*CFA(LegAngle,0,0))
  294. RLeg = newPart(2,2,2,mech,Torso.CFrame,"Transparent","nonCollide")
  295. RLegW = newWeld6D(RThigh,RThigh,RLeg,CF(0,-5,0),CF(0,0,0)*CFA(LegAngle,0,0))
  296. for i,v in pairs{LLeg,RLeg} do
  297. newWeld(Torso,v,newPart(2,1.6,2,mech,nil,"CylinderMesh"),CF(0,0,0)*CFA(0,0,90))
  298. newWeld(Torso,v,newPart(1,1,1,mech,nil,"CylinderMesh"),CF(0,-6,0)*CFA(0,0,90))
  299. newWeld(Torso,v,newPart(1.599,2,1,mech,nil),CFA(4,0,0)*CF(0,-1,-0.49))
  300. newWeld(Torso,v,newPart(1.599,2,1,mech,nil,"Wedge"),CFA(4,0,0)*CF(0,-1,0.5)*CFA(180,0,0))
  301. newWeld(Torso,v,newPart(1.6,3.2,1,mech,nil,"Torso"),CFA(4,0,0)*CF(0,-2-0.8,-0.355)*CFA(165+5,0,0)*CF(0,0.7,0))
  302. newWeld(Torso,v,newPart(1,1.15,1,mech,nil),CF(0,-6,0)*CFA(-17,0,0)*CF(0,0.575,0))
  303. for i=-1,1,2 do
  304. local baa = newPart(0.5,0.4,0.5,mech,nil,"CylinderMesh","Dark stone grey")
  305. newWeld(Torso,v,baa,CF(-0.25*i,-5.5,0.5)*CFA(-5,0,2.2*i))
  306. newWeld(Torso,baa,newPart(0.4,5,0.4,mech,nil,"CylinderMesh","Black"),CF(0,2.5,0))
  307. newWeld(Torso,baa,newPart(0.5,0.5,0.5,mech,nil,"Sphere","Dark stone grey"),CF(0,-0.15,0))
  308. newWeld(Torso,baa,newPart(0.7,1.8,0.7,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,4.1-0.4,0))
  309. end
  310. end
  311. LFoot = newPart(2,2,2,mech,nil,"Transparent","nonCollide")
  312. LFootW = newWeld6D(LLeg,LLeg,LFoot,CF(0,-6,0),CF(0,0,0)*CFA(FootAngle,0,0))
  313. RFoot = newPart(2,2,2,mech,nil,"Transparent","nonCollide")
  314. RFootW = newWeld6D(RLeg,RLeg,RFoot,CF(0,-6,0),CF(0,0,0)*CFA(FootAngle,0,0))
  315. for i,v in pairs{LFoot,RFoot} do
  316. newWeld(Torso,v,newPart(0.8,2.8,0.8,mech,nil,"CylinderMesh","nonCollide","S0.5","Dark stone grey"),CF(0,-1,-5)*CFA(0,0,90))
  317. newWeld(Torso,v,newPart(0.6,2.81,0.6,mech,nil,"CylinderMesh","nonCollide","S0.5","Black"),CF(0,-1,-5)*CFA(0,0,90))
  318. newWeld(Torso,v,newPart(1,0.5,1,mech,nil,"CylinderMesh","nonCollide","S0.5"),CF(0,-1,-5)*CFA(0,-1,90))
  319. newWeld(Torso,v,newPart(1,0.25,1,mech,nil,"CylinderMesh","nonCollide","S0.5"),CF(-0.125-0.65-0.4,-1,-5)*CFA(0,0,90))
  320. newWeld(Torso,v,newPart(1,0.25,1,mech,nil,"CylinderMesh","nonCollide","S0.5"),CF(0.125+0.65+0.4,-1,-5)*CFA(0,0,90))
  321. newWeld(Torso,v,newPart(0.501,1,1,mech,nil,"nonCollide"),CF(0,-1,-4.5))
  322. newWeld(Torso,v,newPart(0.251,1,1,mech,nil,"nonCollide"),CF(-0.125-0.65-0.4,-1,-4.5))
  323. newWeld(Torso,v,newPart(0.251,1,1,mech,nil,"nonCollide"),CF( 0.125+0.65+0.4,-1,-4.5))
  324. newWeld(Torso,v,newPart(1,0.5,5.5,mech,nil,"Wedge"),CF(-0.9-0.15,-1,-1.25)*CFA(0,180,-90))
  325. newWeld(Torso,v,newPart(1,0.5,5.5,mech,nil,"Wedge"),CF( 0.9+0.15,-1,-1.25)*CFA(0,180, 90))
  326. newWeld(Torso,v,newPart(1.6,1,5.5,mech,nil),CF(0,-1,-1.25)) --asd
  327. newWeld(Torso,v,newPart(0.8,1.7,0.8,mech,nil,"CylinderMesh","nonCollide","Dark stone grey"),CF(0,0,0)*CFA(0,0,90))
  328. newWeld(Torso,v,newPart(0.6,1.71,0.6,mech,nil,"CylinderMesh","nonCollide","Black"),CF(0,0,0)*CFA(0,0,90))
  329. for i=-1,1,2 do
  330. newWeld(Torso,v,newPart(0.6,1,1,mech,nil,"Wedge"),CF(0.5*i,-1,2)*CFA(0,180,180)) --heel
  331. newWeld(Torso,v,newPart(0.3,0.5,0.8,mech,nil),CF(0.65*i, 0.25,0)*CFA(0,0,0))
  332. newWeld(Torso,v,newPart(0.3,0.5,1.6,mech,nil),CF(0.65*i,-0.25,0)*CFA(0,0,0))
  333. newWeld(Torso,v,newPart(0.3,0.5,0.4,mech,nil,"Wedge"),CF(0.65*i,0.25,-0.6)*CFA(0, 0,0))
  334. newWeld(Torso,v,newPart(0.3,0.5,0.4,mech,nil,"Wedge"),CF(0.65*i,0.25, 0.6)*CFA(0,180,0))
  335. newWeld(Torso,v,newPart(0.3,0.5,0.2,mech,nil,"Wedge"),CF(0.65*i,-0.25,-0.9)*CFA(0, 0,0))
  336. newWeld(Torso,v,newPart(0.3,0.5,0.2,mech,nil,"Wedge"),CF(0.65*i,-0.25, 0.9)*CFA(0,180,0))
  337. end
  338. end
  339. LToe = newPart(3,1,1,mech,nil,"Dark stone grey","Transparent")
  340. LToeW = newWeld6D(LFoot,LFoot,LToe,CF(0,-1,-5),CF(0,0,0)*CFA(ToeAngle,0,0))
  341. RToe = newPart(3,1,1,mech,nil,"Dark stone grey","Transparent")
  342. RToeW = newWeld6D(RFoot,RFoot,RToe,CF(0,-1,-5),CF(0,0,0)*CFA(ToeAngle,0,0))
  343. for i,v in pairs{LToe,RToe} do
  344. local part = newPart(0.8,1,3,mech,nil,"Wedge","Dark stone grey")
  345. newWeld(Torso,v,part,CF(-0.65,0,-1.75))
  346. local part = newPart(0.8,1,3,mech,nil,"Wedge","Dark stone grey")
  347. newWeld(Torso,v,part,CF(0.65,0,-1.75))
  348. local part = newPart(0.8,1,1,mech,nil,"Wedge","Dark stone grey")
  349. newWeld(Torso,v,part,CF(-0.65,0,0.25)*CFA(180,0,0))
  350. local part = newPart(0.8,1,1,mech,nil,"Wedge","Dark stone grey")
  351. newWeld(Torso,v,part,CF( 0.65,0,0.25)*CFA(180,0,0))
  352. newWeld(Torso,v,newPart(4,3,5,mech,nil,"Transparent"),CF(0,1,-1.5))
  353. end
  354.  
  355.  
  356. ---------------TORSO1 LOWER (NOT Y TURN)
  357. newWeld(Torso,Torso1,newPart(5,3,3,mech,nil,"Torso"),CF(0,-0.5,0)*CFA(180,90,0)) --lowest torso
  358. newWeld(Torso,Torso1,newPart(1.6,3.4,1.6,mech,nil,"CylinderMesh","nonCollide","Dark stone grey"),CF(0,-0.8,-0.55)*CFA(0,0,90))
  359. for i=-1,1,2 do
  360. newWeld(Torso,Torso1,newPart(1.5,1.5,1.5,mech,nil,"Sphere","nonCollide"),CF(3*i,0,0))
  361. newWeld(Torso,Torso1,newPart(1.2,2.4,1.2,mech,nil,"CylinderMesh","nonCollide"),CF(3*i,0,0)*CFA(-55,55*i,0)*CF(0,0,-1.2)*CFA(90,0,0))
  362. end
  363. --Tail
  364. newWeld(Torso,Torso1,newPart(2.5,1.5,2.5,mech,nil,"CylinderMesh"),CF(0,-0.5,2)*CFA(90,0,0)*CF(0,0.5-0.25,0))
  365. newWeld(Torso,Torso1,newPart(2.3,0.2,2.3,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,-0.5,2)*CFA(90,0,0)*CF(0,1-0.09,0))
  366. newWeld(Torso,Torso1,newPart(2,0.5,0.2,mech,nil,"Black"),CF(0,-0.5,2+1-0.08)*CFA(0,0,0))
  367.  
  368.  
  369.  
  370.  
  371. CockpitGlass = {}
  372. ---------------------TORSO2 UPPER
  373. newWeld(Torso,Torso2,newPart(2.9,0.2,2.9,mech,nil,"CylinderMesh","nonCollide","Really black"),CF(0,1-0.09,0))
  374. newWeld(Torso,Torso2,newPart(2.9,0.2,2.9,mech,nil,"CylinderMesh","nonCollide","Really black"),CF(0,1+2+0.09,0))
  375. newWeld(Torso,Torso2,newPart(2.6,2,2.6,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,1+1,0))
  376.  
  377. for i=0.2,1.8,0.4 do
  378. newWeld(Torso,Torso2,newPart(3.1+i/3,0.2,3.1+i/3,mech,nil,"CylinderMesh","nonCollide"),CF(0,1+i,0))
  379. end
  380. newWeld(Torso,Torso2,newPart(8,5,4,mech,nil,"Torso"),CF(0,1+2+2.5,0)*CFA(180,90,0)) -- upper
  381.  
  382. Ceiling = newPart(4,0.2,6,mech,nil)
  383. newWeld(Torso,Torso2,Ceiling,CF(0,16.9,0))
  384.  
  385. newWeld(Torso,Torso2,newPart(4,1,1,mech,nil),CF(0,8-0.5,-4.5)) --floor front
  386. --front glass part
  387. newWeld(Torso,Torso2,newPart(4.4,1,0.2,mech,nil),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,0.5,0))
  388. newWeld(Torso,Torso2,newPart(0.25,4.4,0.25,mech,nil,"CylinderMesh"),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)*CFA(0,0,90)) --glass metal
  389. CockpitGlass[#CockpitGlass+1] = newWeld(Torso,Torso2,newPart(4.4,2+0.1,0.2,mech,nil),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,1+1,0)).Part1
  390. newWeld(Torso,Torso2,newPart(0.25,4.4,0.25,mech,nil,"CylinderMesh"),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)*CFA(0,0,90)) --glass metal
  391. CockpitGlass[#CockpitGlass+1] = newWeld(Torso,Torso2,newPart(4.4,1+3.35,0.2,mech,nil),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)*CFA(30+19.8,0,0)*CF(0,0.5+1.675,0)).Part1
  392. newWeld(Torso,Torso2,newPart(4.4,3,0.2,mech,nil),CF(0,17,-3)*CFA(-135-5,0,0)*CF(0,1.5,0)) --upper ceiling
  393. newWeld(Torso,Torso2,newPart(0.25,4.4,0.25,mech,nil,"CylinderMesh"),CF(0,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)*CFA(30+19.8,0,0)*CF(0,1+3.35,0)*CFA(0,0,90)) --glass metal
  394.  
  395.  
  396. for i=-1,1,2 do
  397. newWeld(Torso,Torso2,newPart(6.2,3,2,mech,nil,"Torso"),CF(3*i,1+2+3.5,0)*CFA(180,90,0)) --side torsos
  398. newWeld(Torso,Torso2,newPart(3,1,3,mech,nil,"CylinderMesh"),CF(2.5*i,5,0)*CFA(0,0,90)) -- hipgun
  399.  
  400. newWeld(Torso,Torso2,newPart(1,2,2,mech,nil,"Wedge"),CF(3*i,8-0.5,-4)*CFA(0,-90*i,90*i)) --floorwedge
  401. newWeld(Torso,Torso2,newPart(1,1,2,mech,nil,"Wedge"),CF(3*i,8-0.5, 3.5)*CFA(0,-90*i,90*-i))
  402.  
  403. newWeld(Torso,Torso2,newPart(0.2, 6,6.2,mech,nil),CF(4*i,8,-0.1)*CFA(0,0,-10*i)*CF(-0.1*i,3,0)) --sidewalls
  404. newWeld(Torso,Torso2,newPart(0.2,4.3,6.2,mech,nil),CF(4*i,8,-0.1)*CFA(0,0,-10*i)*CF(0,6,0)*CFA(0,0,55*i)*CF(0,2.15,0)) --sidewall upper
  405. newWeld(Torso,Torso2,newPart(0.2,1,math.sqrt(2*2+2*2)+0.1,mech,nil),CF(-2.9*i,8,-4)*CFA(0,-45*i,25*i)*CF(0,0.5,0.05)) --side front
  406.  
  407. --metal glasses
  408. newWeld(Torso,Torso2,newPart(0.25,4,0.25,mech,nil,"CylinderMesh"),CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+1-1,0))
  409. newWeld(Torso,Torso2,newPart(0.25,4.4,0.25,mech,nil,"CylinderMesh"),CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)*CFA(30+19.8,0,0)*CF(0,0.5+1.675,0))
  410. newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0))
  411. newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)*CFA(30+19.8,0,0)*CF(0,1+3.35,0))
  412. local p1 = (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p
  413. local p2 = (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p
  414. local len = (p1-p2).magnitude
  415. local cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  416. newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  417. newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),Torso2.CFrame:toObjectSpace(cf*CF(0,len/2,0)))
  418. p1 = (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p
  419. len = (p1-p2).magnitude
  420. cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  421. newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  422. p1 = (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p
  423. len = (p1-p2).magnitude
  424. cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  425. newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  426. newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),Torso2.CFrame:toObjectSpace(cf*CF(0,-len/2,0)))
  427. p2 = (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p
  428. len = (p1-p2).magnitude
  429. cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  430. newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  431.  
  432. local t1,t2 = fillTriangle1Mech{ --upper glass
  433. (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  434. (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p;
  435. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;}
  436. CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  437. CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  438. local t1,t2 = fillTriangle1Mech{ --mid glass
  439. (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  440. (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p;
  441. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  442. CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  443. CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  444. local t1,t2 = fillTriangle1Mech{ --lower glass
  445. (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  446. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  447. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  448. CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  449. CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  450.  
  451. fillTriangle1Mech{ --sidewall upper front
  452. (Torso2.CFrame*CF(2.2*i,17,-3)).p;
  453. (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p;
  454. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;}
  455.  
  456. fillTriangle1Mech{ --sidewall lower front
  457. (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p;
  458. (Torso2.CFrame*CF(2.9*i,8,-4)*CFA(0,45*i,-25*i)*CF(0,1,math.sqrt(2*2+2*2)/2+0.1)).p;
  459. (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  460.  
  461. fillTriangle1Mech{ --sides and back ceiling
  462. (Torso2.CFrame*CF(2*i,8,4)).p;
  463. (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  464. (Torso2.CFrame*CF(4*i,8,3)).p;}
  465. fillTriangle1Mech{
  466. (Torso2.CFrame*CF(4*i,8,3)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  467. (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  468. (Torso2.CFrame*CF(4*i,8,3)).p;}
  469. fillTriangle1Mech{
  470. (Torso2.CFrame*CF(4*i,8,3)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  471. (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  472. (Torso2.CFrame*CF(2*i,16.5+0.5,3)).p;}
  473.  
  474.  
  475.  
  476.  
  477. end
  478.  
  479. --roof designs
  480. newWeld(Torso,Torso2,newPart(9,1,1,mech,nil,"Wedge"),CF(0,17.5,-1.5))
  481. newWeld(Torso,Torso2,newPart(4.4,1,2,mech,nil,"Wedge"),CF(0,17.5,-2))
  482. newWeld(Torso,Torso2,newPart(4.4,1,4,mech,nil,"Wedge"),CF(0,18.5, 1))
  483. newWeld(Torso,Torso2,newPart(4.4,2,3,mech,nil,"Wedge"),CF(0,18, 4.5)*CFA(0,180,0))
  484. newWeld(Torso,Torso2,newPart(9,1,4,mech,nil),CF(0,17.5, 1))
  485. newWeld(Torso,Torso2,newPart(4.4,3,3.3,mech,nil,"Wedge"),CF(0,17-1.65, 4.5)*CFA(-90,0,0))
  486.  
  487. LShoulder = newPart(2.6,2.6,2.6,mech,nil,"Dark stone grey","Sphere")
  488. LShoulderW = newWeld6D(Torso2,Torso2,LShoulder,CF(-8,16,0),CF(0,0,0)*CFA(30,0,8))
  489. RShoulder = newPart(2.6,2.6,2.6,mech,nil,"Dark stone grey","Sphere")
  490. RShoulderW = newWeld6D(Torso2,Torso2,RShoulder,CF( 8,16,0),CF(0,0,0)*CFA(30,0,-8))
  491.  
  492. BackBooster = {}
  493. for i=-1,1,2 do --back torso design
  494. local v = newPart(4,4,4,mech,nil,"CylinderMesh")
  495. newWeld(Torso,Torso2,v,CF(4.5*i,15.5,3.75)*CFA(-15,0,5*i))
  496. newWeld(Torso,v,newPart(3.65,2,3.65,mech,nil,"CylinderMesh"),CF(0,-2,0)*CFA(2,0,0)*CF(0,0,0))
  497. newWeld(Torso,v,newPart(3.2,3,3.2,mech,nil,"CylinderMesh"),CF(0,-2,0)*CFA(4,0,0)*CF(0,-1.5,0.1))
  498. local backboost = newPart(2.4,0.2,2.4,mech,nil,"CylinderMesh","Really black","Neon")
  499. newWeld(Torso,v,backboost,CF(0,-2,0)*CFA(4,0,0)*CF(0,-2.91,0.1))
  500. BackBooster[i] = newI{"ParticleEmitter",backboost
  501. ,Lifetime = NumberRange.new(0.8,1)
  502. ,LightEmission=1
  503. ,Color = ColorSequence.new(Color3.new(178/255,248/255,255/255),Color3.new(0/255,0/255,255/255))
  504. ,Texture = assetprefix.."346519018"
  505. ,LockedToPart=true
  506. ,EmissionDirection="Bottom"
  507. ,Rate=600
  508. ,Speed = NumberRange.new(6,6)
  509. ,Rotation = NumberRange.new(-180,-180)
  510. ,RotSpeed = NumberRange.new(-90,-90)
  511. ,VelocitySpread=0
  512. ,Acceleration=V3(0,-15,0)
  513. ,Enabled=false
  514. }
  515. for y=1,6 do
  516. newWeld(Torso,v,newPart(1,1,0.4,mech,nil,"Wedge"),CF(0,-2,0)*CFA(4,0,0)*CF(0,-3-0.5,0.1)*CFA(0,y*60,0)*CF(0,0,1.5-0.2)*CFA(180,0,0))
  517. end
  518. end
  519.  
  520.  
  521. for i,v in pairs{[-1]=LShoulder,[1]=RShoulder} do
  522. newWeld(Torso,v,newPart(3,0.75,3,mech,nil,"CylinderMesh"),CFA(0,0, 50)) --x
  523. newWeld(Torso,v,newPart(3,0.75,3,mech,nil,"CylinderMesh"),CFA(0,0,-50)) --x
  524. newWeld(Torso,Torso2,newPart(6,2.5,2,mech,nil,"Torso"),CF(-5.5*i,17-0.25,0)*CFA(0,90,0)) --shoulder
  525. newWeld(Torso,Torso2,newPart(4.5,2.5,3,mech,nil,"Torso"),CF(-8*i,17+0.5,0)*CFA(0,90,0))
  526.  
  527. newWeld(Torso,Torso2,newPart(1.6,2,2,mech,nil,"Wedge"),CF(-5.5*i,14.5, 1.5)*CFA(180,90*i,0))
  528. newWeld(Torso,Torso2,newPart(1.6,2,2,mech,nil,"Wedge"),CF(-5.5*i,14.5,-1.5)*CFA(180,90*i,0))
  529. newWeld(Torso,Torso2,newPart(5,3,2.5,mech,nil,"Wedge"),CF(-3.5*i,15.5,0.5)*CFA(180,-90*i,0))
  530.  
  531. newWeld(Torso,Torso2,newPart(4.3,2.5,3,mech,nil,"Wedge"),CF(-4.35*i,16.75,3.5)*CFA(180,0,0))
  532.  
  533.  
  534. newWeld(Torso,v,newPart(3,1,3,mech,nil,"Wedge"),CF(0,-11.5, 1)*CFA(180,0, 0))
  535. newWeld(Torso,v,newPart(3,2,1,mech,nil,"Wedge"),CF(0,-11 , -1)*CFA( 0,0,180))
  536. newWeld(Torso,v,newPart(3,1,3,mech,nil,"Wedge"),CF(0,-10.5, 1)*CFA( 0,180,0))
  537.  
  538. newWeld(Torso,v,newPart(2.8,1,2.2,mech,nil,"Wedge"),CF(0,-2.5,0.6)*CFA(180,0, 0))
  539. newWeld(Torso,v,newPart(2.8,2,1,mech,nil,"Wedge"),CF(0,-2 , -1)*CFA( 180,180,180))
  540. newWeld(Torso,v,newPart(2.8,1,2.2,mech,nil,"Wedge"),CF(0,-1.5,0.6)*CFA( 0,180,0))
  541. newWeld(Torso,v,newPart(0.8,1.7,0.8,mech,nil,"CylinderMesh","Dark stone grey"),CF(-0.6,-1.3,0.9)*CFA(-15,0,-7))
  542. newWeld(Torso,v,newPart(0.8,1.7,0.8,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0.6,-1.3,0.9)*CFA(-15,0,7))
  543.  
  544. newWeld(Torso,v,newPart(4,1.42,4,mech,nil,"CylinderMesh","Dark stone grey"),CF(-0.7*i,-4,2)*CFA(0,0,90))--cylinder upper shoulder
  545. newWeld(Torso,v,newPart(3,0.2,3,mech,nil,"CylinderMesh"),CF(-1.5*i,-4,2)*CFA(0,0,90))
  546. newWeld(Torso,v,newPart(4,1.41,4,mech,nil,"CylinderMesh"),CF(-0.7*i,-4-0.25,1.5-0.5)*CFA(0,0,90))
  547. newWeld(Torso,v,newPart(2.05,3.19,2.05,mech,nil,"CylinderMesh","Dark stone grey"),CF(-0.1*i,-4,2)*CFA(0,0,90))
  548. newWeld(Torso,v,newPart(1.5,1.6,1.5,mech,nil,"CylinderMesh","Black"),CF(0.7*i,-4,2)*CFA(0,0,90))
  549. newWeld(Torso,v,newPart(1.4,5,2,mech,nil,"Dark stone grey"),CF(0.69*i,-4,2)*CFA(12.5,0,0)*CF(0,-2.5,0))
  550. newWeld(Torso,v,newPart(1.4,2.8,2,mech,nil,"Dark stone grey"),CF(0.69*i,-4,2)*CFA(129,0,0)*CF(0,-1.4,0))
  551. for x=50,110,30 do
  552. newWeld(Torso,v,newPart(1.3,1.6,1.3,mech,nil,"CylinderMesh","Dark stone grey"),CF(-0.7*i,-4-0.25,1.5-0.5)*CFA(x,0,0)*CF(0,2+0.8,0))
  553. newWeld(Torso,v,newPart(1,0.2,1,mech,nil,"CylinderMesh"),CF(-0.7*i,-4-0.25,1.5-0.5)*CFA(x,0,0)*CF(0,2+1.6-0.09,0))
  554. end
  555. newWeld(Torso,v,newPart(1.4,6.6,1.4,mech,nil,"CylinderMesh"),CF(-0.7*i,-4-0.25,1+2)*CFA( 5,0,0)*CF(0,-3.3,-0.7))
  556. newWeld(Torso,v,newPart(1.4,6,1.4,mech,nil,"CylinderMesh"),CF(-0.7*i,-4-0.25,1-2)*CFA(-2,0,0)*CF(0,-3, 0.7))
  557. newWeld(Torso,v,newPart(1.4,6,2.3,mech,nil),CF(-0.7*i,-7,0.8))
  558.  
  559. newWeld(Torso,v,newPart(4.2,2,3,mech,nil,"Torso"),CF(0,-9.55,0.75)*CFA(14,90,0))
  560.  
  561. end
  562.  
  563. LElbow = newPart(1,1,1,mech,nil)
  564. LElbowW = newWeld6D(LShoulder,LShoulder,LElbow,CF(0,-12,0),CF(0,0,0)*CFA(-90,0,0))
  565. RElbow = newPart(1,1,1,mech,nil)
  566. RElbowW = newWeld6D(RShoulder,RShoulder,RElbow,CF(0,-12,0),CF(0,0,0)*CFA(-90-10,0,0))
  567.  
  568. for i,v in pairs{[-1]=LElbow,[1]=RElbow} do
  569. newWeld(Torso,v,newPart(2.4,3.5,2.4,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,0,0)*CFA(0,0,90))
  570. newWeld(Torso,v,newPart(1.7,3.8,1.7,mech,nil,"CylinderMesh","Black"),CF(0,0,0)*CFA(0,0,90))
  571. newWeld(Torso,v,newPart(3,0.6,3,mech,nil,"CylinderMesh","Really black"),CF(0,0,0)*CFA(0,0,90))
  572. if i == -1 then
  573. newWeld(Torso,v,newPart(2.2,2,2.5,mech,nil,"Torso"),CF(0,-0.5,1.3)*CFA(90,90,0)) --z y x --y z x
  574. newWeld(Torso,v,newPart(1.4,2,1,mech,nil,"Dark stone grey"),CF(0,-1,0))
  575.  
  576. newWeld(Torso,v,newPart(0.75,2.4,0.75,mech,nil,"CylinderMesh","Dark stone grey"),CF(-0.6,-1.6,1.3)*CFA(30,0,0))
  577. newWeld(Torso,v,newPart(0.75,2.4,0.75,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0.6,-1.6,1.3)*CFA(30,0,0))
  578.  
  579. newWeld(Torso,v,newPart(2,2.2,2,mech,nil,"Wedge"),CF(0,-1.9,-1.5))
  580. newWeld(Torso,v,newPart(3,1,2,mech,nil),CF(0,-2.5,0))
  581.  
  582. end
  583. end
  584.  
  585. --Left Arm
  586. newWeld(Torso,LElbow,newPart(3,3.5,4,mech,nil,"Wedge"),CF(0,-3-2,-0.75)*CFA(-90,0,0))
  587. newWeld(Torso,LElbow,newPart(5,4,5,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,-3-2.5,0)*CFA(0,0,90))
  588. newWeld(Torso,LElbow,newPart(2.4,5,2.4,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,-3-2.5,0)*CFA(0,0,90))
  589. newWeld(Torso,LElbow,newPart(4,1.2,4,mech,nil,"CylinderMesh","Black"),CF(0,-3-2.5+1,-1)*CFA(0,0,90))
  590. --newWeld(Torso,LElbow,newPart(4.99,2.3,1.1,mech,nil,"Dark stone grey"),CF(0,-3-2.5-0.5,0))
  591. for i=-1,1,2 do
  592. newWeld(Torso,LElbow,newPart(1,4,4,mech,nil,"Sphere"),CF(2*i,-3-2.5,0)*CFA(0,0,0))
  593. newWeld(Torso,LElbow,newPart(0.7,5,0.7,mech,nil,"CylinderMesh","Dark stone grey"),CF(0.6*i,-3-5+1+1.2+0.5,1.3+1.8-0.45)*CFA(-10,0,0)*CF(0,2.5,0))
  594. end
  595. newWeld(Torso,LElbow,newPart(2.6,6,2.6,mech,nil),CF(0,-3-5-1,0)) --
  596. newWeld(Torso,LElbow,newPart(3.5,6,1.1,mech,nil,"Dark stone grey"),CF(0,-3-5-1,0))
  597. newWeld(Torso,LElbow,newPart(2.6,3,1.8,mech,nil,"Wedge"),CF(0,-3-5+1,1.3+0.9)*CFA(180,0,0))
  598. newWeld(Torso,LElbow,newPart(1,2.6,1,mech,nil,"CylinderMesh"),CF(0,-3-5+1+1.2+0.5,1.3+1.8-0.45)*CFA(0,0,90))
  599. newWeld(Torso,LElbow,newPart(1,1.4,1,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,-3-5-3.5,1.3)*CFA(0,0,90))
  600. newWeld(Torso,LElbow,newPart(1.4,4,1,mech,nil,"Dark stone grey"),CF(0,-3-5-3.5+2,1.3))
  601. newWeld(Torso,LElbow,newPart(1.5,6,1.5,mech,nil,"Dark stone grey","CylinderMesh"),CF(0,-3-5-3.5+2.5,-2.2+1))
  602. newWeld(Torso,LElbow,newPart(2,3,2,mech,nil,"Dark stone grey","CylinderMesh"),CF(0,-3-5,-2.2+1))
  603. newWeld(Torso,LElbow,newPart(2.5,3,2.5,mech,nil,"Dark stone grey","CylinderMesh"),CF(0,-3-3.5,-2.2+1))
  604. newWeld(Torso,LElbow,newPart(2.6,1,1,mech,nil,"Wedge"),CF(0,-3-2.5+1,-2.5-0.5+0.2)*CFA(0,180,0))
  605. newWeld(Torso,LElbow,newPart(2.6,1,1,mech,nil),CF(0,-3-2.5,-2.5-0.5+0.2))
  606. newWeld(Torso,LElbow,newPart(2.6,2,2,mech,nil,"Wedge"),CF(0,-3-2.5-1-0.5,-2.5+0.2)*CFA(0,0,180))
  607.  
  608. LeftGunUse = false
  609. LeftGun = newPart(4,1,4,mech,nil,"CylinderMesh","Dark stone grey")
  610. LeftGunW = newWeld(Torso,LElbow,LeftGun,CF(0,-3-5-4.5,0)*CFA(0,0,0))
  611. newWeld(Torso,LeftGun,newPart(1.6,1,1.6,mech,nil,"Dark stone grey"),CF(0,-1,0))
  612. LeftGunSmoke = newI{"Smoke",LeftGun,Color=Color3.new(20/255,20/255,20/255),Opacity=0.5,Enabled=false,RiseVelocity=-10,Size=2}
  613. for i=120,360,120 do
  614. newWeld(Torso,LeftGun,newPart(1.6,1,1.6,mech,nil,"Dark stone grey"),CF(0,-1,0)*CFA(0,i,0)*CF(0,0,-2+0.8))
  615. newWeld(Torso,LeftGun,newPart(1,1,1,mech,nil,"Ring","Dark stone grey"),CF(0,-1.5-2,0)*CFA(0,i,0)*CF(0,0,-2+0.85)*CFA(90,0,0)).Part1.Mesh.Scale=V3(1.6,1.6,25)
  616. newWeld(Torso,LeftGun,newPart(2.66,1,1,mech,nil,"Dark stone grey"),CF(0,-1,0)*CFA(0,i+60,0)*CF(0,0,-2+0.81))
  617. local ghole = newPart(1.75,0.5,1.75,mech,nil,"Really black","Sphere","Neon")
  618. newWeld(Torso,LeftGun,ghole,CF(0,-1.5-2-0.5,0)*CFA(0,i,0)*CF(0,0,-2+0.85)) -- gun hole
  619. end
  620.  
  621. --Right Arm
  622. local of1 = 2
  623. local of2 = -5.2
  624. newWeld(Torso,RElbow,newPart(3.5,3,2.4,mech,nil,"Dark stone grey"),CFA(-55,0,0)*CF( 0,-1.5,0))
  625. newWeld(Torso,RElbow,newPart(3,4,3,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0,of2+3.5,of1)*CFA(0,0,90))
  626. newWeld(Torso,RElbow,newPart(7,1,2,mech,nil,"Torso"),CF( 0,of2-1,of1-1.5-1.5)*CFA(-90,90,0))
  627. newWeld(Torso,RElbow,newPart(5,0.5,1,mech,nil,"Torso"),CF( 0,of2-5,of1-1.5-1.25)*CFA(-90,90,0))
  628. newWeld(Torso,RElbow,newPart(6,0.8,1.4,mech,nil,"Torso"),CF( 0,of2-1,of1+1.5+1.4)*CFA( 90,90,0))
  629. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(0,of2-3-3,of1-1.5-0.5)) --upper long
  630. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(-0.535,of2-3-3,of1-1.5-0.825)*CFA(0, 70,0)*CF(-1,0,0))
  631. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF( 0.535,of2-3-3,of1-1.5-0.825)*CFA(0,-70,0)*CF( 1,0,0))
  632. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(0,of2-3-3,of1+1.5+0.5)) --lower long
  633. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(-0.535,of2-3-3,of1+1.5+0.825)*CFA(0,-70,0)*CF(-1,0,0))
  634. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF( 0.535,of2-3-3,of1+1.5+0.825)*CFA(0, 70,0)*CF( 1,0,0))
  635. newWeld(Torso,RElbow,newPart(3.4,2,4,mech,nil,"Wedge"),CF( 0,of2+1,of1-1.5)*CFA(-90,0,180))
  636. newWeld(Torso,RElbow,newPart(3.4,4,2,mech,nil,"Wedge"),CF( 0,of2+1,of1+1.5)*CFA( 0,0,180))
  637. newWeld(Torso,RElbow,newPart(1.7,2,1.7,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0,of2+2,of1)*CFA( 0,0,180))
  638. newWeld(Torso,RElbow,newPart(1.3,2.01,1.3,mech,nil,"CylinderMesh","Really black"),CF( 0,of2+2,of1)*CFA( 0,0,180))
  639.  
  640.  
  641. newWeld(Torso,RElbow,newPart(3.4,1,5,mech,nil),CF( 0,of2+3.5,of1)*CFA( 0,0,180))
  642. newWeld(Torso,RElbow,newPart(3.4,1,5,mech,nil,"Wedge"),CF( 0,of2+1.5,of1+3)*CFA(-90,0,180))
  643. newWeld(Torso,RElbow,newPart(3.4,2,2,mech,nil,"Wedge"),CF( 0,of2+5,of1-1.5)*CFA(0,0,0))
  644. newWeld(Torso,RElbow,newPart(3.4,2,4,mech,nil,"Wedge"),CF( 0,of2+5,of1+1.5)*CFA(0,180,0))
  645.  
  646. newWeld(Torso,RElbow,newPart(2.6,1,3,mech,nil,"Dark stone grey"),CF( 0,of2+5.25,of1+1.5+0.5)*CFA(27,0,0))
  647. for x=60,360,60 do
  648. newWeld(Torso,RElbow,newPart(5,1,3.45,mech,nil),CF( 0,of2+4.5,of1+1.5+0.25)*CFA(27,0,0)*CF(0,1+3,0)*CFA(x,0,0)*CF(0,2.5,0))
  649. end
  650. newWeld(Torso,RElbow,newPart(5.5,4,5.5,mech,nil,"Dark stone grey","CylinderMesh"),CF( 0,of2+4.5,of1+1.5+0.25)*CFA(27,0,0)*CF(0,1+3,0)*CFA(0,0,90))
  651. for i=-1,1,2 do
  652. newWeld(Torso,RElbow,newPart(0.6,0.25,1.6,mech,nil,"Black"),CF(1.2*i,of2-14,of1))
  653. for ii=1,10 do
  654. newWeld(Torso,RElbow,newPart(0.6,0.25,2,mech,nil,"Black"),CF(1.2*i,of2-14.75+ii*1.7,of1)*CFA(ii%2==0 and 56 or -56,0,0))
  655. end
  656. end
  657.  
  658.  
  659. Hatch = newPart(4,6,0.2,mech,nil)
  660. HatchW = newWeld6D(Torso2,Torso2,Hatch,CF(0,11-3,4),CF(0,-3,-0.1)*CFA(-20,0,0)) -- x is -20
  661. newWeld(Torso,Torso2,newPart(4,4.5,0.2,mech,nil),CF(0,8,4)*CFA(20,0,0)*CF(0,6,0)*CFA(-20-42,0,0)*CF(0,2.25,0))
  662.  
  663. Seat = newI{"Seat",mech,Name="Seat",formFactor="Symmetric",Size=V3(2,1,2),TopSurface="SmoothNoOutlines"}
  664. SeatW = newWeld6D(Torso2,Torso2,Seat,CF(0,8.5,0))
  665. newWeld(Torso,Seat,newPart(2,1,1,mech,nil,"Wedge"),CF(0,0,-1.5))
  666. newWeld(Torso,Seat,newPart(2,2.6,0.8,mech,nil),CF(0,0.5+1.15,0.8)*CFA(10,0,0))
  667. newWeld(Torso,Seat,newPart(2,1.2,0.8,mech,nil),CF(0,0.5+2.9,1)*CFA(0,0,0))
  668.  
  669.  
  670. Head = newPart(1,1,1,mech,nil,"nonCollide","Transparent")
  671. Head.Name="Head"
  672. HeadW = newWeld(Torso,Torso,Head,CF(0,2,0))
  673.  
  674. for i,v in pairs(CockpitGlass) do
  675. v.Transparency = 0.6
  676. end
  677. CockpitGlassD = false
  678. for i,v in pairs(mech:children()) do
  679. if v:IsA'BasePart' and v.Material==Enum.Material.SmoothPlastic and v.Transparency==0 then
  680. v.Material="Metal"
  681. end
  682. end
  683.  
  684. Base.Name="HumanoidRootPart" BaseW.Name = "Root Hip"
  685. Torso.Name="Torso"
  686. Torso1.Name = "LowerTorso" Torso1W.Name = "Lower Hip"
  687. Torso2.Name = "UpperTorso" Torso2W.Name = "Upper Hip"
  688. LThigh.Name = "LeftThigh" LThighW.Name = "LThigh"
  689. RThigh.Name = "RightThigh" RThighW.Name = "RThigh"
  690. LLeg.Name = "LeftLeg" LLegW.Name = "LLeg"
  691. RLeg.Name = "RightLeg" RLegW.Name = "RLeg"
  692. LFoot.Name = "LeftFoot" LFootW.Name = "LFoot"
  693. RFoot.Name = "RightFoot" RFootW.Name = "RFoot"
  694. LToe.Name = "LeftToe" LToeW.Name = "LToe"
  695. RToe.Name = "RightToe" RToeW.Name = "RToe"
  696. LShoulder.Name = "LeftShoulder" LShoulderW.Name = "LShoulder"
  697. RShoulder.Name = "RightShoulder" RShoulderW.Name = "RShoulder"
  698. LElbow.Name = "LeftElbow" LElbowW.Name = "LElbow"
  699. RElbow.Name = "RightElbow" RElbowW.Name = "RElbow"
  700. Hatch.Name = "Hatch" HatchW.Name = "Hatch"
  701. SeatW.Name="Seat"
  702.  
  703.  
  704. ----
  705. checkGroundTouch = function()
  706. local Hit1,Pos1 = ray(LToe.Position,LToe.CFrame*CF(0,-1,0).p-LToe.Position,mech,3)
  707. local Hit2,Pos2 = ray(RToe.Position,RToe.CFrame*CF(0,-1,0).p-RToe.Position,mech,3)
  708. if Hit1 or Hit2 then return 1 end
  709. return 0
  710. end
  711. ----
  712.  
  713. doAfterT = {}
  714. doAfter = function(t,f)
  715. local key = (MRND(-100,100)*MRND(-100,100)).."a"..MRND(-999999,999999)
  716. doAfterT[key] = {Time=t,Func=f,Current=0}
  717. return key
  718. end
  719. doInT = {}
  720. doIn = function(t,f,f2)
  721. local key = (MRND(-100,100)*MRND(-100,100)).."a"..MRND(-999999,999999)
  722. doInT[key] = {Time=t,Func=f,FuncEnd=f2,Current=0}
  723. return key
  724. end
  725.  
  726.  
  727. Motors = {["BaseW"]=BaseW,["Torso1W"]=Torso1W,["Torso2W"]=Torso2W,["LThighW"]=LThighW,["RThighW"]=RThighW,["LLegW"]=LLegW,["RLegW"]=RLegW,["LFootW"]=LFootW,["RFootW"]=RFootW,["LToeW"]=LToeW,["RToeW"]=RToeW,
  728. ["LShoulderW"]=LShoulderW,["RShoulderW"]=RShoulderW,["LElbowW"]=LElbowW,["RElbowW"]=RElbowW,["HatchW"]=HatchW,["SeatW"]=SeatW}
  729.  
  730. print(#mech:getChildren().." Parts")
  731. _G.mech = mech
  732. _G.RMM2 = getfenv()
  733. _G.m = _G.RMM2
  734.  
  735. gw = function()
  736. print(" ")
  737. for i,weldn in pairs{"LThighW","LLegW","LFootW","LToeW","RThighW","RLegW","RFootW","RToeW","LShoulderW","LElbowW","RShoulderW","RElbowW","BaseW","Torso1W","Torso2W","HatchW","SeatW"} do
  738. weld = getfenv()[weldn]
  739. local a,b,c = weld.C0:toEulerAnglesXYZ()
  740. local d,e,f = weld.C1:toEulerAnglesXYZ()
  741. inde = function(n)
  742. n = math.floor(n*1000+0.5)/1000
  743. return string.rep(" ",5-#(""..n))..n
  744. end
  745. --print(weldn..".C0 = CF("..inde(weld.C0.x)..","..inde(weld.C0.y)..","..inde(weld.C0.z)..")*CFA("..inde(MD(a))..","..inde(MD(b))..","..inde(MD(c))..")")
  746. print(" addAnim("..weldn..string.rep(" ",10-#weldn)..",1,t,nil,{"..inde(weld.C1.x)..","..inde(weld.C1.y)..","..inde(weld.C1.z)..","..inde(MD(d))..","..inde(MD(e))..","..inde(MD(f)).."})")
  747. end
  748. print(" ")
  749. end
  750. gwBool = newI{"BoolValue",mech,Name="GetWelds"}
  751. gwBool.Changed:connect(function()
  752. if not gwBool.Value then return end
  753. gwBool.Value=false
  754. gw()
  755. end)
  756. gw2 = function()
  757. print(" ")
  758. for i,weldn in pairs{"LS","RS","LH","RH"} do
  759. weld = getfenv()[weldn]
  760. local a,b,c = weld.C0:toEulerAnglesXYZ()
  761. local d,e,f = weld.C1:toEulerAnglesXYZ()
  762. inde = function(n)
  763. n = math.floor(n*1000+0.5)/1000
  764. return string.rep(" ",5-#(""..n))..n
  765. end
  766. print(" addAnim("..weldn..string.rep(" ",10-#weldn)..",0,t,nil,{"..inde(weld.C0.x)..","..inde(weld.C0.y)..","..inde(weld.C0.z)..","..inde(MD(a))..","..inde(MD(b))..","..inde(MD(c)).."})")
  767. print(" addAnim("..weldn..string.rep(" ",10-#weldn)..",1,t,nil,{"..inde(weld.C1.x)..","..inde(weld.C1.y)..","..inde(weld.C1.z)..","..inde(MD(d))..","..inde(MD(e))..","..inde(MD(f)).."})")
  768. end
  769. print(" ")
  770. end
  771. ------
  772. Anims = {} -- {WELD,C0or1,Time,CFStart,CFEnd,Current}
  773. addAnim = function(weld,C0or1,Time,CFStart,CFEnd)
  774. if not weld then return end
  775. local CC = "C"..C0or1
  776. if not CFStart then
  777. local a,b,c = weld[CC]:toEulerAnglesXYZ()
  778. CFStart = {weld[CC].x,weld[CC].y,weld[CC].z,MD(a),MD(b),MD(c)}
  779. end
  780. if not CFEnd[1] and not CFEnd[2] and not CFEnd[3] then
  781. CFEnd[1] = weld[CC].x
  782. CFEnd[2] = weld[CC].y
  783. CFEnd[3] = weld[CC].z
  784. end
  785. Anims[weld.Name..CC] = {weld=weld,CC="C"..C0or1,CFStart=CFStart,CFEnd=CFEnd,Time=Time,Current=0}
  786. end
  787. --
  788. WalkKey = {}
  789. loadAnim = {} _G.la = loadAnim
  790. --
  791. ClearWalk = function()
  792. for i,v in pairs(WalkKey) do
  793. doAfterT[i] = nil
  794. WalkKey[i] = nil
  795. end
  796. end
  797. --
  798. loadAnim.Open = function(a,t)
  799. t = t or 1.5
  800. addAnim(LThighW ,1,t,nil,{nil,nil,nil, -75, 0, 0})
  801. addAnim(LLegW ,1,t,nil,{nil,nil,nil, 155, 0, 0})
  802. addAnim(LFootW ,1,t,nil,{nil,nil,nil, -80, 0, 0})
  803. addAnim(LToeW ,1,t,nil,{nil,nil,nil, 0, 0, 0})
  804. addAnim(RThighW ,1,t,nil,{nil,nil,nil, -75, 0, 0})
  805. addAnim(RLegW ,1,t,nil,{nil,nil,nil, 155, 0, 0})
  806. addAnim(RFootW ,1,t,nil,{nil,nil,nil, -80, 0, 0})
  807. addAnim(RToeW ,1,t,nil,{nil,nil,nil, 0, 0, 0})
  808. addAnim(LShoulderW,1,t,nil,{nil,nil,nil, 20, 0, 8})
  809. addAnim(LElbowW ,1,t,nil,{nil,nil,nil, -90, 0, 0})
  810. addAnim(RShoulderW,1,t,nil,{nil,nil,nil, -20, 0, -8})
  811. addAnim(RElbowW ,1,t,nil,{nil,nil,nil, -60, 0, 0})
  812. addAnim(BaseW ,1,t,nil,{ 0,10.2-10.2, 0, 0, 0, 0})
  813. addAnim(Torso1W ,1,t,nil,{nil,nil,nil, 0, 0, 0})
  814. addAnim(Torso2W ,1,t,nil,{nil,nil,nil, 0, 0, 0})
  815. addAnim(HatchW ,1,t,nil,{nil,nil,nil,-180, 0, 0})
  816. addAnim(SeatW ,0,t,nil,{-0.6,8.5, 5, 0, 180, 0})
  817. doAfter(t,function() addAnim(SeatW ,0,t*0.5,nil,{ 0, -1, 5.3, 0, 180, 0}) end)
  818. end
  819. loadAnim.Close = function(a,t)
  820. addAnim(SeatW ,0,t*0.5,nil,{ -0.6, 8.5, 5, 0, 180, 0})
  821. doAfter(t*0.5,function() loadAnim:Standing(1) end)
  822. end
  823. loadAnim.Standing = function(a,t)
  824. t = t or 1
  825. addAnim(LThighW ,1,t,nil,{ 1.5, 0.5, 0, -25, 0, 0})
  826. addAnim(LLegW ,1,t,nil,{ 0, 0, 0, 75, 0, 0})
  827. addAnim(LFootW ,1,t,nil,{ 0, 0, 0, 10, 0, 0})
  828. addAnim(LToeW ,1,t,nil,{ 0, 0, 0, -60, 0, 0})
  829. addAnim(RThighW ,1,t,nil,{ -1.5, 0.5, 0, -25, 0, 0})
  830. addAnim(RLegW ,1,t,nil,{ 0, 0, 0, 75, 0, 0})
  831. addAnim(RFootW ,1,t,nil,{ 0, 0, 0, 10, 0, 0})
  832. addAnim(RToeW ,1,t,nil,{ 0, 0, 0, -60, 0, 0})
  833. addAnim(LShoulderW,1,t,nil,{ 0, 0, 0, 30, 0, 8})
  834. addAnim(LElbowW ,1,t,nil,{ 0, 0, 0, -90, 0, 0})
  835. addAnim(RShoulderW,1,t,nil,{ 0, 0, 0, 30, 0, -8})
  836. addAnim(RElbowW ,1,t,nil,{ 0, 0, 0, -100, 0, 0})
  837. addAnim(BaseW ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  838. addAnim(Torso1W ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  839. addAnim(Torso2W ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  840. addAnim(HatchW ,1,t,nil,{ 0, -3, -0.1, -20, 0, 0})
  841. addAnim(SeatW ,0,t,nil,{ 0, 8.5, 0, 0, 0, 0})
  842. end
  843. loadAnim.ReturnLeg = function(a,t)
  844. t = t or 0.5
  845. addAnim(LThighW ,1,t,nil,{ 1.5, 0.5, 0, -25, 0, 0})
  846. addAnim(LLegW ,1,t,nil,{ 0, 0, 0, 75, 0, 0})
  847. addAnim(LFootW ,1,t,nil,{ 0, 0, 0, 10, 0, 0})
  848. addAnim(LToeW ,1,t,nil,{ 0, 0, 0, -60, 0, 0})
  849. addAnim(RThighW ,1,t,nil,{ -1.5, 0.5, 0, -25, 0, 0})
  850. addAnim(RLegW ,1,t,nil,{ 0, 0, 0, 75, 0, 0})
  851. addAnim(RFootW ,1,t,nil,{ 0, 0, 0, 10, 0, 0})
  852. addAnim(RToeW ,1,t,nil,{ 0, 0, 0, -60, 0, 0})
  853. end
  854. loadAnim.ReturnArm = function(a,t)
  855. t = t or 0.5
  856. addAnim(LShoulderW,1,t,nil,{ 0, 0, 0, 30, 0, 8})
  857. addAnim(LElbowW ,1,t,nil,{ 0, 0, 0, -90, 0, 0})
  858. addAnim(RShoulderW,1,t,nil,{ 0, 0, 0, 30, 0, -8})
  859. addAnim(RElbowW ,1,t,nil,{ 0, 0, 0, -100, 0, 0})
  860. end
  861. loadAnim.WalkL = function(a,t)
  862. local WalkSpeed = 0.3
  863. local tu = Turn==0 and 0 or (Turn<0 and 45 or -45)
  864. addAnim(LThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -65, tu, 0})
  865. addAnim(LLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 115, 0, 0})
  866. addAnim(LFootW ,1,WalkSpeed ,nil,{ 0, 0, 0, -20, 0, 0})
  867. addAnim(LToeW ,1,WalkSpeed ,nil,{ 0, 0, 0, -30, 0, 0})
  868. addAnim(RThighW ,1,WalkSpeed*2,nil,{ nil, nil, nil, 15, tu, 0})
  869. addAnim(RLegW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 35, 0, 0})
  870. addAnim(RFootW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 30, 0, 0})
  871. addAnim(RToeW ,1,WalkSpeed*2,nil,{ 0, 0, 0, -80, 0, 0})
  872. wkey = doAfter(WalkSpeed,function()
  873. addAnim(LThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -45, tu, 0})
  874. addAnim(LLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 35, 0, 0})
  875. addAnim(LFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 60, 0, 0})
  876. addAnim(LToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -50, 0, 0})
  877. end)
  878. WalkKey[wkey] = true
  879. wkey = doAfter(WalkSpeed*2,function()
  880. addAnim(LThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -20, tu, 0})
  881. addAnim(LLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 65, 0, 0})
  882. addAnim(LFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 10, 0, 0})
  883. addAnim(LToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -50, 0, 0})
  884. addAnim(RThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -35, tu, 0})
  885. addAnim(RLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 105, 0, 0})
  886. addAnim(RFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 40, 0, 0})
  887. addAnim(RToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -40, 0, 0})
  888. end)
  889. WalkKey[wkey] = true
  890. end
  891. loadAnim.WalkR = function(a,t)
  892. local WalkSpeed = 0.3
  893. local tu = Turn==0 and 0 or (Turn<0 and 45 or -45)
  894. addAnim(LThighW ,1,WalkSpeed*2,nil,{ nil, nil, nil, 15, tu, 0})
  895. addAnim(LLegW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 35, 0, 0})
  896. addAnim(LFootW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 30, 0, 0})
  897. addAnim(LToeW ,1,WalkSpeed*2,nil,{ 0, 0, 0, -80, 0, 0})
  898. addAnim(RThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -65, tu, 0})
  899. addAnim(RLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 115, 0, 0})
  900. addAnim(RFootW ,1,WalkSpeed ,nil,{ 0, 0, 0, -20, 0, 0})
  901. addAnim(RToeW ,1,WalkSpeed ,nil,{ 0, 0, 0, -30, 0, 0})
  902. wkey = doAfter(WalkSpeed,function()
  903. addAnim(RThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -45, tu, 0})
  904. addAnim(RLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 35, 0, 0})
  905. addAnim(RFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 60, 0, 0})
  906. addAnim(RToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -50, 0, 0})
  907. end)
  908. WalkKey[wkey] = true
  909. wkey = doAfter(WalkSpeed*2,function()
  910. addAnim(LThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -35, tu, 0})
  911. addAnim(LLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 105, 0, 0})
  912. addAnim(LFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 40, 0, 0})
  913. addAnim(LToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -40, 0, 0})
  914. addAnim(RThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -20, tu, 0})
  915. addAnim(RLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 65, 0, 0})
  916. addAnim(RFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 10, 0, 0})
  917. addAnim(RToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -50, 0, 0})
  918. end)
  919. WalkKey[wkey] = true
  920. end
  921. loadAnim.Walk2L = function(a,t)
  922. local WalkSpeed = 0.4
  923. local tu = Turn==0 and 0 or (Turn<0 and 45 or -45)
  924. addAnim(LThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -15, tu, 0})
  925. addAnim(LLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 105, 0, 0})
  926. addAnim(LFootW ,1,WalkSpeed ,nil,{ 0, 0, 0,24.286, 0, 0})
  927. addAnim(LToeW ,1,WalkSpeed ,nil,{ 0, 0, 0,-74.286, 0, 0})
  928. addAnim(RThighW ,1,WalkSpeed*2,nil,{ nil, nil, nil, -45, tu, 0})
  929. addAnim(RLegW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 45, 0, 0})
  930. addAnim(RFootW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 50, 0, 0})
  931. addAnim(RToeW ,1,WalkSpeed*2,nil,{ 0, 0, 0, -50, 0, 0})
  932. wkey = doAfter(WalkSpeed,function()
  933. addAnim(LThighW ,1,WalkSpeed,nil,{ nil, nil, nil, 15, tu, 0})
  934. addAnim(LLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 35, 0, 0})
  935. addAnim(LFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 30, 0, 0})
  936. addAnim(LToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -80, 0, 0})
  937. end)
  938. WalkKey[wkey] = true
  939. end
  940. loadAnim.Walk2R = function(a,t)
  941. local WalkSpeed = 0.4
  942. local tu = Turn==0 and 0 or (Turn<0 and 45 or -45)
  943. addAnim(LThighW ,1,WalkSpeed*2,nil,{ nil, nil, nil, -45, tu, 0})
  944. addAnim(LLegW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 45, 0, 0})
  945. addAnim(LFootW ,1,WalkSpeed*2,nil,{ 0, 0, 0, 50, 0, 0})
  946. addAnim(LToeW ,1,WalkSpeed*2,nil,{ 0, 0, 0, -50, 0, 0})
  947. addAnim(RThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -15, tu, 0})
  948. addAnim(RLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 105, 0, 0})
  949. addAnim(RFootW ,1,WalkSpeed ,nil,{ 0, 0, 0,24.286, 0, 0})
  950. addAnim(RToeW ,1,WalkSpeed ,nil,{ 0, 0, 0,-74.286, 0, 0})
  951. wkey = doAfter(WalkSpeed,function()
  952. addAnim(RThighW ,1,WalkSpeed,nil,{ nil, nil, nil, 15, tu, 0})
  953. addAnim(RLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 35, 0, 0})
  954. addAnim(RFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 30, 0, 0})
  955. addAnim(RToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -80, 0, 0})
  956. end)
  957. WalkKey[wkey] = true
  958. end
  959. loadAnim.RunL = function(a,t)
  960. local WalkSpeed = 0.24
  961. addAnim(LThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -105, 0, 0})
  962. addAnim(LLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 115, 0, 0})
  963. addAnim(LFootW ,1,WalkSpeed ,nil,{ 0, 0, 0, 10, 0, 0})
  964. addAnim(LToeW ,1,WalkSpeed ,nil,{ 0, 0, 0, -40, 0, 0})
  965. addAnim(RThighW ,1,WalkSpeed*1.5,nil,{ nil, nil, nil, 50, 0, 0})
  966. addAnim(RLegW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, 5, 0, 0})
  967. addAnim(RFootW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, 10, 0, 0})
  968. addAnim(RToeW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, -65, 0, 0})
  969. wkey = doAfter(WalkSpeed,function()
  970. WalkSpeed = 0.12
  971. addAnim(LThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -75, 0, 0})
  972. addAnim(LLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 75, 0, 0})
  973. addAnim(LFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 40, 0, 0})
  974. addAnim(LToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -40, 0, 0})
  975. end)
  976. WalkKey[wkey] = true
  977. end
  978. loadAnim.RunR = function(a,t)
  979. local WalkSpeed = 0.24
  980. addAnim(LThighW ,1,WalkSpeed*1.5,nil,{ nil, nil, nil, 50, 0, 0})
  981. addAnim(LLegW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, 5, 0, 0})
  982. addAnim(LFootW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, 10, 0, 0})
  983. addAnim(LToeW ,1,WalkSpeed*1.5,nil,{ 0, 0, 0, -65, 0, 0})
  984. addAnim(RThighW ,1,WalkSpeed ,nil,{ nil, nil, nil, -105, 0, 0})
  985. addAnim(RLegW ,1,WalkSpeed ,nil,{ 0, 0, 0, 115, 0, 0})
  986. addAnim(RFootW ,1,WalkSpeed ,nil,{ 0, 0, 0, 10, 0, 0})
  987. addAnim(RToeW ,1,WalkSpeed ,nil,{ 0, 0, 0, -30, 0, 0})
  988. wkey = doAfter(WalkSpeed,function()
  989. WalkSpeed = 0.12
  990. addAnim(RThighW ,1,WalkSpeed,nil,{ nil, nil, nil, -75, 0, 0})
  991. addAnim(RLegW ,1,WalkSpeed,nil,{ 0, 0, 0, 75, 0, 0})
  992. addAnim(RFootW ,1,WalkSpeed,nil,{ 0, 0, 0, 40, 0, 0})
  993. addAnim(RToeW ,1,WalkSpeed,nil,{ 0, 0, 0, -30, 0, 0})
  994. end)
  995. WalkKey[wkey] = true
  996. end
  997. loadAnim.Jump = function(a,t)
  998. local t = 0.4
  999. addAnim(LThighW ,1,t,nil,{ 1.5, 0.5, 0,-74.779,-9.656,2.613})
  1000. addAnim(LLegW ,1,t,nil,{ 0, 0, 0, 155, 0, 0})
  1001. addAnim(LFootW ,1,t,nil,{ 0, 0, 0, -80, 0, 0})
  1002. addAnim(LToeW ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  1003. addAnim(RThighW ,1,t,nil,{ -1.5, 0.5, 0,-84.923,9.962,-0.88})
  1004. addAnim(RLegW ,1,t,nil,{ 0, 0, 0, 155, 0, 0})
  1005. addAnim(RFootW ,1,t,nil,{ 0, 0, 0, -70, 0, 0})
  1006. addAnim(RToeW ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  1007. addAnim(LShoulderW,1,t,nil,{ 0, 0, 0, 10, 0, 8})
  1008. addAnim(LElbowW ,1,t,nil,{ 0, 0, 0, -110, 0, 0})
  1009. addAnim(RShoulderW,1,t,nil,{ 0, 0, 0, 30, 0, -8})
  1010. addAnim(RElbowW ,1,t,nil,{ 0, 0, 0, -130, 0, 0})
  1011. addAnim(Torso1W ,1,t,nil,{ 0, 0, 0, 20, 0, 0})
  1012. doAfter(t,function()
  1013. local t = 0.2
  1014. addAnim(LThighW ,1,t,nil,{ 1.5, 0.5, 0,-15.455,-19.312,-0.077})
  1015. addAnim(LLegW ,1,t,nil,{ 0, 0, 0, 85, 0, 0})
  1016. addAnim(LFootW ,1,t,nil,{ 0, 0, 0, -10, 0, 0})
  1017. addAnim(LToeW ,1,t,nil,{ 0, 0, 0, -30, 0, 0})
  1018. addAnim(RThighW ,1,t,nil,{ -1.5, 0.5, 0,-14.923,9.962,-0.88})
  1019. addAnim(RLegW ,1,t,nil,{ 0, 0, 0, 85, 0, 0})
  1020. addAnim(RFootW ,1,t,nil,{ 0, 0, 0, -10, 0, 0})
  1021. addAnim(RToeW ,1,t,nil,{ 0, 0, 0, -30, 0, 0})
  1022. addAnim(Torso1W ,1,t,nil,{ 0, 0, 0, 0, 0, 0})
  1023. end)
  1024. end
  1025. Base.CanCollide=false
  1026. --------------------------------------------------------------------------
  1027. Player = owner
  1028. if not Player then print'not found' mech:MoveTo(V3(0,0,0)) return end
  1029. Hum = newI{"Humanoid",mech} Hum.PlatformStand=true
  1030. Char = owner.Character
  1031. CTorso = Char.Torso
  1032. CHRP = Char.HumanoidRootPart
  1033. LS = CTorso:findFirstChild'Left Shoulder'
  1034. RS = CTorso:findFirstChild'Right Shoulder'
  1035. LH = CTorso:findFirstChild'Left Hip'
  1036. RH = CTorso:findFirstChild'Right Hip'
  1037.  
  1038. if Char:findFirstChild(mech.Name) then Char[mech.Name]:Destroy() end
  1039. mech.Parent = Char
  1040. Base.Name="HRP"
  1041. ------
  1042. Pilot = nil
  1043. Anim = "Opening"
  1044. AnimLegs = true --use leg pose
  1045. AnimArms = true --use arm pose
  1046. AnimTorso = true --use torso pose
  1047. WalkDir = 0
  1048. ------
  1049. SeatWeld = nil
  1050. Seat.ChildAdded:connect(function(weld)
  1051. SeatWeld = weld
  1052. Pilot = weld.Part1==CHRP and CHRP or nil
  1053. pcall(function()
  1054. weld.C1 = CF(0,-1.5,0.25)*CFA(-95,0,0)
  1055. LS2 = weld.Part1.Parent.Torso:findFirstChild'Left Shoulder' LS2.Parent = nil
  1056. RS2 = weld.Part1.Parent.Torso:findFirstChild'Right Shoulder' RS2.Parent = nil
  1057. LH2 = weld.Part1.Parent.Torso:findFirstChild'Left Hip' LH2.Parent = nil
  1058. RH2 = weld.Part1.Parent.Torso:findFirstChild'Right Hip' RH2.Parent = nil
  1059. LS1 = newI{"Weld",weld.Part1.Parent.Torso,Part0=weld.Part1.Parent.Torso,Part1=weld.Part1.Parent:findFirstChild'Left Arm' ,Name="RM1"}
  1060. RS1 = newI{"Weld",weld.Part1.Parent.Torso,Part0=weld.Part1.Parent.Torso,Part1=weld.Part1.Parent:findFirstChild'Right Arm',Name="RM2"}
  1061. LH1 = newI{"Weld",weld.Part1.Parent.Torso,Part0=weld.Part1.Parent.Torso,Part1=weld.Part1.Parent:findFirstChild'Left Leg' ,Name="RM3"}
  1062. RH1 = newI{"Weld",weld.Part1.Parent.Torso,Part0=weld.Part1.Parent.Torso,Part1=weld.Part1.Parent:findFirstChild'Right Leg',Name="RM4"}
  1063. LS1.C0 = CF(-1.2,0.5,-0.5)*CFA(0,0,0)
  1064. LS1.C1 = CF( 0,0.5,0)*CFA(-80,-10,10)
  1065. RS1.C0 = CF( 1.2,0.5,-0.5)*CFA(0,0,0)
  1066. RS1.C1 = CF( 0,0.5,0)*CFA(-80, 10,-10)
  1067. LH1.C0 = CF(-0.5, -1,-0.3)*CFA(0,0,0)
  1068. LH1.C1 = CF( 0, 1,0)*CFA(-45,0, 5)
  1069. RH1.C0 = CF( 0.5, -1,-0.3)*CFA(0,0,0)
  1070. RH1.C1 = CF( 0, 1,0)*CFA(-45,0,-5)
  1071. end)
  1072. end)
  1073. Seat.ChildRemoved:connect(function(weld)
  1074. pcall(function()
  1075. local mm = weld.Part1.Parent
  1076. for i=1,4 do
  1077. mm.Torso["RM"..i]:Destroy()
  1078. end
  1079. LS2.Parent = mm.Torso
  1080. LS2.Part0 = mm.Torso
  1081. LS2.Part1 = mm["Left Arm"]
  1082. RS2.Parent = mm.Torso
  1083. RS2.Part0 = mm.Torso
  1084. RS2.Part1 = mm["Right Arm"]
  1085. LH2.Parent = mm.Torso
  1086. LH2.Part0 = mm.Torso
  1087. LH2.Part1 = mm["Left Leg"]
  1088. RH2.Parent = mm.Torso
  1089. RH2.Part0 = mm.Torso
  1090. RH2.Part1 = mm["Right Leg"]
  1091. end)
  1092. Pilot = nil
  1093. end)
  1094. ------
  1095. Gyro = newI{"BodyGyro",Base,cframe=Base.CFrame,maxTorque=V3(5000000,5000000,5000000),P=15000}
  1096. WeightForce = newI{"BodyForce",Base,Force=V3(0,-1000000,0)}
  1097. Turn = 0
  1098. Velo = newI{"BodyVelocity",Base,maxForce=V3N}
  1099. veloym = 0
  1100. veloy = 0
  1101. ------
  1102.  
  1103. Key = {}
  1104. --[[
  1105. X Open/Close
  1106. C Jump
  1107. WASD Movement
  1108. P Cockpit glass
  1109. --]]
  1110. WalkingSpeed = 16
  1111. onKeyDown = function(k)
  1112. if k=="a" then
  1113. Turn = 10
  1114. elseif k=="d" then
  1115. Turn = -10
  1116. end
  1117. --
  1118. if k=="x" and Anim=="Opened" then
  1119. Anim="Closing"
  1120. AnimLegs,AnimArms,AnimTorso,Movement=false,false,false,false
  1121. loadAnim:Close(2)
  1122. wait(2)
  1123. Anim="None"
  1124. AnimLegs,AnimArms,AnimTorso,Movement=true,true,true,true
  1125. elseif k=="x" and Anim=="None" then
  1126. Anim="Opening"
  1127. ClearWalk()
  1128. AnimLegs,AnimArms,AnimTorso,Movement=false,false,false,false
  1129. loadAnim:Open(2)
  1130. wait(3)
  1131. Anim="Opened"
  1132. elseif (k=="w" or k=="a" or k=="d") and not Key.s and Movement and Pilot and WalkDir~=1 and AnimLegs then
  1133. WalkDir=1
  1134. ClearWalk()
  1135. local whichLeg = -1
  1136. while (Key.w or Key.a or Key.d) and not Key.s and Movement and Pilot do
  1137. loadAnim[(Key["0"] and "Run" or "Walk")..(whichLeg==-1 and "L" or "R")]()
  1138. WalkingSpeed = Key["0"] and 18*4.5 or 18
  1139. whichLeg = whichLeg*-1
  1140. if not AnimLegs then repeat wait() until AnimLegs end
  1141. local duration = (Key["0"] and 0.36 or 0.9)
  1142. for i=duration/8,duration,duration/8 do wait(duration/8) if (Key.w or Key.a or Key.d) and not Key.s and Movement and Pilot then else break end end
  1143. if not AnimLegs then repeat wait() until AnimLegs end
  1144. end
  1145. WalkDir=0
  1146. ClearWalk()
  1147. if Movement and Anim=="None" then
  1148. loadAnim:Standing(0.5)
  1149. end
  1150. elseif k=="s" and not Key.w and Movement and Pilot and AnimLegs then
  1151. WalkDir=-1
  1152. ClearWalk()
  1153. local whichLeg = -1
  1154. while Key.s and not Key.w and Movement and Pilot do
  1155. loadAnim["Walk2"..(whichLeg==-1 and "L" or "R")]()
  1156. whichLeg = whichLeg*-1
  1157. if not AnimLegs then repeat wait() until AnimLegs end
  1158. for i=0.1,0.8,0.1 do wait(0.1) if Key.s and not Key.w and Movement and Pilot then else break end end
  1159. if not AnimLegs then repeat wait() until AnimLegs end
  1160. end
  1161. WalkDir=0
  1162. ClearWalk()
  1163. if Movement and Anim=="None" then
  1164. loadAnim:Standing(0.5)
  1165. end
  1166. elseif k=="c" and Movement and Pilot and AnimLegs and AnimTorso and checkGroundTouch()>0 then
  1167. AnimLegs,AnimArms,AnimTorso=false,false,false
  1168. ClearWalk()
  1169. loadAnim:Jump()
  1170. wait(0.5)
  1171. AnimTorso=true
  1172. AnimArms=true
  1173. veloym = 10000000
  1174. loadAnim:ReturnArm(0.3)
  1175. if Key.c then BackBooster[-1].Enabled = true BackBooster[1].Enabled = true veloy = 100 wait(1) else veloy = 75 wait(0.5) end
  1176. BackBooster[-1].Enabled = false BackBooster[1].Enabled = false
  1177. veloym = 0
  1178. veloy = 0
  1179. AnimLegs=true
  1180. if WalkDir==0 then loadAnim:ReturnLeg() end
  1181. elseif k=="p" and not CockpitGlassD and Pilot then
  1182. CockpitGlassD = true
  1183. if CockpitGlass[1].Transparency==0 then
  1184. doIn(0.7,function(i)
  1185. for x,v in pairs(CockpitGlass) do
  1186. v.Transparency = 0.6*i
  1187. end
  1188. end)
  1189. else
  1190. doIn(0.7,function(i)
  1191. for x,v in pairs(CockpitGlass) do
  1192. v.Transparency = 0.6-0.6*i
  1193. end
  1194. end)
  1195. end
  1196. wait(0.8)
  1197. CockpitGlassD = false
  1198. elseif k =="q" and not LeftGunUse then
  1199. LeftGunUse=true
  1200. if not spinSpeed then spinSpeed=0 end
  1201. for i=1,50 do
  1202. if spinSpeed>40 then spinSpeed=40 end
  1203. LeftGunW.C1=LeftGunW.C1*CFA(0,spinSpeed,0)
  1204. spinSpeed=spinSpeed+0.7
  1205. if i%2==0 then PlaySound(assets.Minigun1,LeftGun,0.4+0.8*spinSpeed/40,1) end
  1206. wait()
  1207. end
  1208. local co=0
  1209. LeftGunSmoke.Enabled=true
  1210. local muzzleFlash = newPart(1,1,1,mech,nil,"Transparent","New Yeller")
  1211. newI{"SpecialMesh",muzzleFlash,MeshType="FileMesh",MeshId=assets.MuzzleFlash,Scale=V3(0.8,3,0.8)}
  1212. local muzzleW = newWeld(LeftGun,LeftGun,muzzleFlash,CF(0,0,0))
  1213. repeat
  1214. co=co+1
  1215. LeftGunW.C1=LeftGunW.C1*CFA(0,spinSpeed,0)
  1216. if co%2==0 then PlaySound(assets.Minigun1,LeftGun,1.2,1) end
  1217. if co%2==0 then
  1218. muzzleFlash.Transparency = 0.5
  1219. PlaySound(assets.Fire1,LeftGun,MRND(600,950)/1000,0.4)
  1220. local bullet = newI{"Part",mech,Name="Bullet",Anchored=true,CanCollide=false,formFactor="Custom",Size=V3(0.5,2,0.5),Debris=10,TopSurface='Smooth',BottomSurface='Smooth'}
  1221. newI{"CylinderMesh",bullet}
  1222. local rotRand = MRND(1,3)*120
  1223. bullet.CFrame=LeftGun.CFrame*CF(0,-6+2,0)*CFA(0,rotRand,0)*CF(0,0,-2+0.85)
  1224. addProjectile(bullet.Position,bullet.CFrame*CF(0,-1,0),800,function() print'boom' end,function(cf) bullet.CFrame=cf*CF(0,0,1)*CFA(90,0,0) end,function() bullet:Destroy() end)
  1225. muzzleW.C0 = CF(0,-6-2,0)*CFA(0,rotRand,0)*CF(0,0,-2+0.85)*CFA(180,0,0)
  1226. else
  1227. muzzleFlash.Transparency=1
  1228. end
  1229. wait()
  1230. until not Key.q
  1231. muzzleFlash:Destroy()
  1232. LeftGunSmoke.Enabled=false
  1233. LeftGunUse=false
  1234. for i=50,1,-0.5 do
  1235. if LeftGunUse then break end
  1236. if spinSpeed<0 then spinSpeed=0 end
  1237. LeftGunW.C1=LeftGunW.C1*CFA(0,spinSpeed,0)
  1238. spinSpeed=spinSpeed-0.35
  1239. if i%2==0 then PlaySound(assets.Minigun1,LeftGun,0.4+0.8*spinSpeed/40,1) end
  1240. wait()
  1241. end
  1242. elseif k=="]" then
  1243. Pilot = Char.Torso
  1244. Char.Humanoid.Sit = true
  1245. elseif k=="0" then
  1246. end
  1247. end
  1248. ------
  1249. onKeyUp = function(k)
  1250. if k=="a" and not Key.d then
  1251. Turn = 0
  1252. elseif k=="d" and not Key.a then
  1253. Turn = 0
  1254. end
  1255. end
  1256. ------
  1257. onButton1Down = function(k)
  1258. end
  1259. ------
  1260. onButton1Up = function(k)
  1261. end
  1262. ------
  1263. Mouse.KeyDown:connect(function(k)
  1264. Key[k]=true
  1265. onKeyDown(k)
  1266. end)
  1267. -------------------------
  1268. Mouse.KeyUp:connect(function(k)
  1269. Key[k]=false
  1270. onKeyUp(k)
  1271. end)
  1272. Mouse.Button1Down:connect(function()
  1273. Button1=true
  1274. onButton1Down()
  1275. end)
  1276. Mouse.Button1Up:connect(function()
  1277. Button1=false
  1278. onButton1Up()
  1279. end)
  1280.  
  1281. doAfter(1,function() Base.CanCollide=false end)
  1282. runcount = 0
  1283. game:getService'RunService'.Stepped:connect(function(aa,step)
  1284. runcount = runcount+1
  1285. --
  1286. if runcount%10==0 and AnimTorso and Movement and Pilot then
  1287. local y=GetY(Base,Mouse.Hit.p)
  1288. addAnim(Torso2W ,1,1,nil,{ 0, 0, 0, 0, -y, 0})
  1289. end
  1290. --
  1291. if AnimArms and Movement and Pilot then
  1292. local x=GetX(Torso2,Mouse.Hit.p)
  1293. if x>40 then x = 40 end
  1294. if x<-120 then x = -120 end
  1295. addAnim(LElbowW ,1,0.5,nil,{ nil, 0, nil, -120-x, 0, 0})
  1296. if x<-60 then x = -60 end
  1297. addAnim(RElbowW ,1,0.5,nil,{ nil, 0, nil, -120-x, 0, 0})
  1298. end
  1299. --
  1300. if runcount%5==0 and Turn~=0 and Movement and Pilot then
  1301. local turntarg = Base.CFrame*CFA(0,Turn,0)*CF(0,0,-1)
  1302. Gyro.cframe = CF(V3(Base.Position.x,0,Base.Position.z),V3(turntarg.x,0,turntarg.z))
  1303. end
  1304. --
  1305. if Key.w and not Key.s and Movement and Pilot and WalkDir==1 then
  1306. Velo.maxForce = V3(10000000,veloym,10000000)
  1307. local velo = Base.CFrame.lookVector*WalkingSpeed
  1308. Velo.Velocity = V3(velo.x,veloy,velo.z)
  1309. elseif Key.s and not Key.w and Movement and Pilot and WalkDir==-1 then
  1310. Velo.maxForce = V3(10000000,veloym,10000000)
  1311. local velo = Base.CFrame.lookVector*-12
  1312. Velo.Velocity = V3(velo.x,veloy,velo.z)
  1313. else
  1314. Velo.maxForce = V3(10000000,veloym,10000000)
  1315. Velo.Velocity = V3(0,veloy,0)
  1316. end
  1317. --
  1318. for i,anim in pairs(Anims) do
  1319. anim.Current = anim.Current + step
  1320. local CFStart = CF(anim.CFStart[1],anim.CFStart[2],anim.CFStart[3])*CFA(anim.CFStart[4],anim.CFStart[5],anim.CFStart[6])
  1321. local CFEnd = CF( anim.CFEnd[1], anim.CFEnd[2], anim.CFEnd[3])*CFA( anim.CFEnd[4], anim.CFEnd[5], anim.CFEnd[6])
  1322. anim.weld[anim.CC] = CFStart:lerp(CFEnd,anim.Current/anim.Time)
  1323. --print(anim.Current)
  1324. if anim.Current>=anim.Time then
  1325. anim.weld[anim.CC] = CFEnd -- 100%
  1326. Anims[i]=nil
  1327. end
  1328. end
  1329. --
  1330. for i,v in pairs(doAfterT) do
  1331. v.Current = v.Current + step
  1332. if v.Current>=v.Time then
  1333. v.Func()
  1334. doAfterT[i] = nil
  1335. end
  1336. end
  1337. --
  1338. for i,v in pairs(doInT) do
  1339. v.Current = v.Current + step
  1340. if v.Current>v.Time then v.Current = v.Time end -- sometimes exceeds
  1341. v.Func(v.Current/v.Time,i,step)
  1342. if doInT[i] and v.Current>=v.Time then
  1343. if v.FuncEnd then v.FuncEnd() end
  1344. doInT[i] = nil
  1345. end
  1346. end
  1347. --
  1348. end)
  1349. loadAnim:Open(0.2)
  1350. Anim = "Opened"
  1351. mech:MoveTo((CTorso.CFrame*CF(0,0,-30)).p)
  1352.  
  1353. --(CTorso.CFrame*CF(0,0,-16)).p)
  1354. -- hl/https://preview.c9users.io/jaspher/rbx_stoof/RMMech.lua
  1355. -- l/_G.m.addAnim(_G.m.BaseW ,1,1,nil,{ 0, 0, 0, 90, 0, 0})
  1356. -- l/_G.m.addAnim(_G.m.LThighW,1,1,nil,{1.5,0.5,0,-25,0,45})
  1357. -- l/_G.la:Open() l/_G.la:Standing()
  1358. -- c/for i,v in pairs(workspace.notrmdx["RM Mech 2"]:children()) do if v:IsA'BasePart' then v:SetNetworkOwner(game.owner.notrmdx) end end -- jew
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement