The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Jarred Ultra Mech script pastebin roblox
By Jarred Ultra Mech on 2024-11-26 08:00 am | Syntax: LUA | Views: 14



New Script | Raw | Show/Hide line no. | Copy text to clipboard
  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 G and L or G, L > G and {Points[1+(S-1)%3], Points[1+(S)%3], Points[1+(S+1)%3]} or V
  113.         end
  114.         local D = V[2]+(V[3]-V[2]).unit*((V[3]-V[2]).unit:Dot(V[1]-V[2]))
  115.         local C, B = (D-V[1]).unit, (V[2]-V[3]).unit
  116.         local A = B:Cross(C)
  117.         S1 = V3(0.2, (V[2]-D).magnitude, (V[1]-D).magnitude)/1  --0.2
  118.         S2 = V3(0.2, (V[3]-D).magnitude, (V[1]-D).magnitude)/1  --0.2
  119.         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
  120.         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
  121.         return C1, C2, S1, S2
  122. end
  123.  
  124. fillTriangle = function(...)
  125.     local C1,C2,S1,S2 = getTriangleValues(...)
  126.     local tri1 = newPart(S1.x,S1.y,S1.z,mech,C1,"Wedge")
  127.     local tri2 = newPart(S2.x,S2.y,S2.z,mech,C2,"Wedge")
  128.     --for i=1,3 do
  129.     --newPart(0.4,0.4,0.4,mech,CF((...)[i]),"nonCollide","Really black","Anchored")
  130.     --end
  131.     return tri1,tri2
  132. end
  133.  
  134.  
  135.  
  136. n = ""
  137.  
  138. ThighAngle = -40
  139. LegAngle = 135
  140. FootAngle = -40
  141. ToeAngle = -LegAngle-ThighAngle-FootAngle
  142.  
  143. ThighAngle = -25
  144. LegAngle = 75
  145. FootAngle = 10
  146. ToeAngle = -LegAngle-ThighAngle-FootAngle
  147.  
  148. --SCROP     SCROP     SCROP     SCROP     SCROP     SCROP     SCROP     SCROP     SCROP     SCROP     SCROP    
  149. pcall(function() workspace["RM Mech 2"]:Remove() end)
  150. mech = newI{"Model",workspace,Name="RM Mech 2"}
  151.  
  152. Base = newPart(10,10,8,mech,CF(0,50,0),"nonCollide")
  153. Base.Transparency=1
  154. Torso = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent")
  155. BaseW = newWeld6D(Base,Base,Torso,CF(0,0,0)*CFA(0,0,0))
  156. Torso1 = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent") --for X Turn
  157. Torso1W = newWeld6D(Torso,Torso,Torso1,CF(0,0,0)*CFA(0,0,0))
  158. Torso2 = newPart(4,4,4,mech,Base.CFrame,"nonCollide","Transparent") --for Y Turning Torso
  159. Torso2W = newWeld6D(Torso1,Torso1,Torso2,CF(0,0,0)*CFA(0,0,0))
  160.  
  161.  
  162. --[[
  163. Stand = newPart(2,2,2,mech,Base.CFrame,"Transparent") --Stand (motor6d never used)
  164. Stand.Name = "Left Leg"
  165. StandW = newWeld6D(Base,Base,Stand,CF(-4.5,-7-0.172-6,0))
  166. Stand = newPart(2,2,2,mech,Base.CFrame,"Transparent")
  167. Stand.Name = "Right Leg"
  168. StandW = newWeld6D(Base,Base,Stand,CF( 4.5,-7-0.172-6,0)) --]]
  169.  
  170. ------------------
  171. fillTriangle1Mech = function(...)
  172.     local t1,t2 = fillTriangle(...)
  173.     newWeld(Torso,Torso2,t1,Torso2.CFrame:toObjectSpace(t1.CFrame))
  174.     newWeld(Torso,Torso2,t2,Torso2.CFrame:toObjectSpace(t2.CFrame))
  175.     return t1,t2
  176. end
  177.  
  178. ------------------
  179. LThigh = newPart(3,3,3,mech,Torso.CFrame,"nonCollide","Transparent")
  180. LThighW = newWeld6D(Torso,Torso,LThigh,CF(-4.5+1.5,0,0),CF( 1.5,0.5,0)*CFA(ThighAngle,0,0))
  181. RThigh = newPart(3,3,3,mech,Torso.CFrame,"nonCollide","Transparent")
  182. RThighW = newWeld6D(Torso,Torso,RThigh,CF( 4.5-1.5,0,0),CF(-1.5,0.5,0)*CFA(ThighAngle,0,0))
  183. for i,v in pairs{[-1]=LThigh,[1]=RThigh} do
  184.     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))
  185.     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))
  186.     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))
  187.    
  188.     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))
  189.     newWeld(Torso,v,newPart(1.1,3.3,1.1,mech,nil,"CylinderMesh","nonCollide","Black"),CF(0,-5,0)*CFA(0,0,90))
  190.     newWeld(Torso,v,newPart(1.6,0.2,1.2,mech,nil),CF(0,-3.9,-0.1))
  191.    
  192.     local newp = newPart(1.6,math.sqrt(1+5.5*5.5)+0.05,0.2,mech,nil)
  193.     local newpw =  newWeld(Torso,v,newp,CF(0,-1.25,1.4-0.52)*CFA(math.deg(math.tan(1/5.5)),0,0))
  194.     if i==-1 then
  195.         LThighPad = newp
  196.         LThighPadW = newpw
  197.     else
  198.         RThighPad = newp
  199.         RThighPadW = newpw
  200.     end
  201.     local newp = newPart(1.6,math.sqrt(0.2^2+5.5^2)+0.05,0.2,mech,nil)
  202.     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))
  203.     if i==-1 then
  204.         LThighPad2 = newp
  205.         LThighPad2W = newpw
  206.     else
  207.         RThighPad2 = newp
  208.         RThighPad2W = newpw
  209.     end
  210.    
  211.     newWeld(Torso,v,newPart(3,1.2,0.8,mech,nil,"Wedge"),CF(0,2.1,-1.5+0.4)*CFA(0,0,0))
  212.     newWeld(Torso,v,newPart(3,1.2,0.6,mech,nil),CF(0,2.1,-1.5+1.1))
  213.     newWeld(Torso,v,newPart(3,1.2,1.6,mech,nil,"Wedge"),CF(0,2.1, 1.5-0.8)*CFA(0,180,0))
  214.     for i=-1,1,2 do
  215.         newWeld(Torso,v,newPart(0.7,7.5,1.6,mech,nil),CF(-1.15*i,-2.25,0))
  216.         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))
  217.         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))
  218.         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))
  219.         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))
  220.     end
  221. end
  222. LLeg = newPart(2,2,2,mech,Torso.CFrame,"Transparent","nonCollide")
  223. LLegW = newWeld6D(LThigh,LThigh,LLeg,CF(0,-5,0),CF(0,0,0)*CFA(LegAngle,0,0))
  224. RLeg = newPart(2,2,2,mech,Torso.CFrame,"Transparent","nonCollide")
  225. RLegW = newWeld6D(RThigh,RThigh,RLeg,CF(0,-5,0),CF(0,0,0)*CFA(LegAngle,0,0))
  226. for i,v in pairs{LLeg,RLeg} do
  227.     newWeld(Torso,v,newPart(2,1.6,2,mech,nil,"CylinderMesh"),CF(0,0,0)*CFA(0,0,90))
  228.     newWeld(Torso,v,newPart(1,1,1,mech,nil,"CylinderMesh"),CF(0,-6,0)*CFA(0,0,90))
  229.     newWeld(Torso,v,newPart(1.599,2,1,mech,nil),CFA(4,0,0)*CF(0,-1,-0.49))
  230.     newWeld(Torso,v,newPart(1.599,2,1,mech,nil,"Wedge"),CFA(4,0,0)*CF(0,-1,0.5)*CFA(180,0,0))
  231.     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))
  232.     newWeld(Torso,v,newPart(1,1.15,1,mech,nil),CF(0,-6,0)*CFA(-17,0,0)*CF(0,0.575,0))
  233.     for i=-1,1,2 do
  234.         local baa = newPart(0.5,0.4,0.5,mech,nil,"CylinderMesh","Dark stone grey")
  235.         newWeld(Torso,v,baa,CF(-0.25*i,-5.5,0.5)*CFA(-5,0,2.2*i))
  236.         newWeld(Torso,baa,newPart(0.4,5,0.4,mech,nil,"CylinderMesh","Black"),CF(0,2.5,0))
  237.         newWeld(Torso,baa,newPart(0.5,0.5,0.5,mech,nil,"Sphere","Dark stone grey"),CF(0,-0.15,0))
  238.         newWeld(Torso,baa,newPart(0.7,1.8,0.7,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,4.1-0.4,0))
  239.     end
  240. end
  241. LFoot = newPart(2,2,2,mech,nil,"Transparent","nonCollide")
  242. LFootW = newWeld6D(LLeg,LLeg,LFoot,CF(0,-6,0),CF(0,0,0)*CFA(FootAngle,0,0))
  243. RFoot = newPart(2,2,2,mech,nil,"Transparent","nonCollide")
  244. RFootW = newWeld6D(RLeg,RLeg,RFoot,CF(0,-6,0),CF(0,0,0)*CFA(FootAngle,0,0))
  245. for i,v in pairs{LFoot,RFoot} do
  246.     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))
  247.     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))
  248.     newWeld(Torso,v,newPart(1,0.5,1,mech,nil,"CylinderMesh","nonCollide","S0.5"),CF(0,-1,-5)*CFA(0,-1,90))
  249.     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))
  250.     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))
  251.     newWeld(Torso,v,newPart(0.501,1,1,mech,nil,"nonCollide"),CF(0,-1,-4.5))
  252.     newWeld(Torso,v,newPart(0.251,1,1,mech,nil,"nonCollide"),CF(-0.125-0.65-0.4,-1,-4.5))
  253.     newWeld(Torso,v,newPart(0.251,1,1,mech,nil,"nonCollide"),CF( 0.125+0.65+0.4,-1,-4.5))
  254.     newWeld(Torso,v,newPart(1,0.5,5.5,mech,nil,"Wedge"),CF(-0.9-0.15,-1,-1.25)*CFA(0,180,-90))
  255.     newWeld(Torso,v,newPart(1,0.5,5.5,mech,nil,"Wedge"),CF( 0.9+0.15,-1,-1.25)*CFA(0,180, 90))
  256.     newWeld(Torso,v,newPart(1.6,1,5.5,mech,nil),CF(0,-1,-1.25)) --asd
  257.     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))
  258.     newWeld(Torso,v,newPart(0.6,1.71,0.6,mech,nil,"CylinderMesh","nonCollide","Black"),CF(0,0,0)*CFA(0,0,90))
  259.     for i=-1,1,2 do
  260.         newWeld(Torso,v,newPart(0.6,1,1,mech,nil,"Wedge"),CF(0.5*i,-1,2)*CFA(0,180,180)) --heel
  261.         newWeld(Torso,v,newPart(0.3,0.5,0.8,mech,nil),CF(0.65*i, 0.25,0)*CFA(0,0,0))
  262.         newWeld(Torso,v,newPart(0.3,0.5,1.6,mech,nil),CF(0.65*i,-0.25,0)*CFA(0,0,0))
  263.         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))
  264.         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))
  265.         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))
  266.         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))
  267.     end
  268. end
  269. LToe = newPart(3,1,1,mech,nil,"Dark stone grey","Transparent")
  270. LToeW = newWeld6D(LFoot,LFoot,LToe,CF(0,-1,-5),CF(0,0,0)*CFA(ToeAngle,0,0))
  271. RToe = newPart(3,1,1,mech,nil,"Dark stone grey","Transparent")
  272. RToeW = newWeld6D(RFoot,RFoot,RToe,CF(0,-1,-5),CF(0,0,0)*CFA(ToeAngle,0,0))
  273. for i,v in pairs{LToe,RToe} do
  274.     local part = newPart(0.8,1,3,mech,nil,"Wedge","Dark stone grey")
  275.     newWeld(Torso,v,part,CF(-0.65,0,-1.75))
  276.     local part = newPart(0.8,1,3,mech,nil,"Wedge","Dark stone grey")
  277.     newWeld(Torso,v,part,CF(0.65,0,-1.75))
  278.     local part = newPart(0.8,1,1,mech,nil,"Wedge","Dark stone grey")
  279.     newWeld(Torso,v,part,CF(-0.65,0,0.25)*CFA(180,0,0))
  280.     local part = newPart(0.8,1,1,mech,nil,"Wedge","Dark stone grey")
  281.     newWeld(Torso,v,part,CF( 0.65,0,0.25)*CFA(180,0,0))
  282.     newWeld(Torso,v,newPart(4,3,5,mech,nil,"Transparent"),CF(0,1,-1.5))
  283. end
  284.  
  285.  
  286. ---------------TORSO1 LOWER (NOT Y TURN)
  287. newWeld(Torso,Torso1,newPart(5,3,3,mech,nil,"Torso"),CF(0,-0.5,0)*CFA(180,90,0)) --lowest torso
  288. 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))
  289. for i=-1,1,2 do
  290.     newWeld(Torso,Torso1,newPart(1.5,1.5,1.5,mech,nil,"Sphere","nonCollide"),CF(3*i,0,0))
  291.     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))
  292. end
  293. --Tail
  294. 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))
  295. 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))
  296. newWeld(Torso,Torso1,newPart(2,0.5,0.2,mech,nil,"Black"),CF(0,-0.5,2+1-0.08)*CFA(0,0,0))
  297.  
  298.  
  299.  
  300.  
  301. CockpitGlass = {}
  302. ---------------------TORSO2 UPPER
  303. newWeld(Torso,Torso2,newPart(2.9,0.2,2.9,mech,nil,"CylinderMesh","nonCollide","Really black"),CF(0,1-0.09,0))
  304. newWeld(Torso,Torso2,newPart(2.9,0.2,2.9,mech,nil,"CylinderMesh","nonCollide","Really black"),CF(0,1+2+0.09,0))
  305. newWeld(Torso,Torso2,newPart(2.6,2,2.6,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,1+1,0))
  306.  
  307. for i=0.2,1.8,0.4 do
  308.     newWeld(Torso,Torso2,newPart(3.1+i/3,0.2,3.1+i/3,mech,nil,"CylinderMesh","nonCollide"),CF(0,1+i,0))
  309. end
  310. newWeld(Torso,Torso2,newPart(8,5,4,mech,nil,"Torso"),CF(0,1+2+2.5,0)*CFA(180,90,0)) -- upper
  311.  
  312. Ceiling = newPart(4,0.2,6,mech,nil)
  313. newWeld(Torso,Torso2,Ceiling,CF(0,16.9,0))
  314.  
  315. newWeld(Torso,Torso2,newPart(4,1,1,mech,nil),CF(0,8-0.5,-4.5)) --floor front
  316. --front glass part
  317. 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))
  318. 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
  319. 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
  320. 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
  321. 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
  322. 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
  323. 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
  324.  
  325.  
  326. for i=-1,1,2 do
  327.     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
  328.     newWeld(Torso,Torso2,newPart(3,1,3,mech,nil,"CylinderMesh"),CF(2.5*i,5,0)*CFA(0,0,90)) -- hipgun
  329.  
  330.     newWeld(Torso,Torso2,newPart(1,2,2,mech,nil,"Wedge"),CF(3*i,8-0.5,-4)*CFA(0,-90*i,90*i)) --floorwedge
  331.     newWeld(Torso,Torso2,newPart(1,1,2,mech,nil,"Wedge"),CF(3*i,8-0.5, 3.5)*CFA(0,-90*i,90*-i))
  332.  
  333.     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
  334.     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
  335.     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
  336.    
  337.     --metal glasses
  338.     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))
  339.     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))
  340.     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))
  341.     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))
  342.     local p1 = (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p
  343.     local p2 = (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p
  344.     local len = (p1-p2).magnitude
  345.     local cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  346.     newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  347.     newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),Torso2.CFrame:toObjectSpace(cf*CF(0,len/2,0)))
  348.     p1 = (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p
  349.     len = (p1-p2).magnitude
  350.     cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  351.     newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  352.     p1 = (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p
  353.     len = (p1-p2).magnitude
  354.     cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  355.     newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  356.     newWeld(Torso,Torso2,newPart(0.25,0.25,0.25,mech,nil,"Sphere"),Torso2.CFrame:toObjectSpace(cf*CF(0,-len/2,0)))
  357.     p2 = (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p
  358.     len = (p1-p2).magnitude
  359.     cf = CF(p1,p2)*CF(0,0,-len/2)*CFA(-90,0,0)
  360.     newWeld(Torso,Torso2,newPart(0.25,len,0.25,mech,nil,"CylinderMesh"),Torso2.CFrame:toObjectSpace(cf))
  361.  
  362.     local t1,t2 = fillTriangle1Mech{ --upper glass
  363.         (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  364.         (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p;
  365.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;}
  366.     CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  367.     CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  368.     local t1,t2 = fillTriangle1Mech{ --mid glass
  369.         (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  370.         (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p;
  371.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  372.     CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  373.     CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  374.     local t1,t2 = fillTriangle1Mech{ --lower glass
  375.         (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1+2,0)).p;
  376.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  377.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  378.     CockpitGlass[#CockpitGlass+1] = t1 newI{"SpecialMesh",t1,MeshType="Wedge",Scale=V3(0,1,1)}
  379.     CockpitGlass[#CockpitGlass+1] = t2 newI{"SpecialMesh",t2,MeshType="Wedge",Scale=V3(0,1,1)}
  380.  
  381.     fillTriangle1Mech{ --sidewall upper front
  382.         (Torso2.CFrame*CF(2.2*i,17,-3)).p;
  383.         (Torso2.CFrame*CF(2.2*i,17,-3)*CFA(-135-5,0,0)*CF(0,3,0)).p;
  384.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(0,6,0)).p;}
  385.  
  386.     fillTriangle1Mech{ --sidewall lower front
  387.         (Torso2.CFrame*CF(2.2*i,8,-4.9)*CFA(-30,0,0)*CF(0,1,0)).p;
  388.         (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;
  389.         (Torso2.CFrame*CF(4*i,8,-3.2)*CFA(0,0,-10*i)*CF(-0.1*i,2,0)).p;}
  390.    
  391.     fillTriangle1Mech{ --sides and back ceiling
  392.         (Torso2.CFrame*CF(2*i,8,4)).p;
  393.         (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  394.         (Torso2.CFrame*CF(4*i,8,3)).p;}
  395.     fillTriangle1Mech{
  396.         (Torso2.CFrame*CF(4*i,8,3)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  397.         (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  398.         (Torso2.CFrame*CF(4*i,8,3)).p;}
  399.     fillTriangle1Mech{
  400.         (Torso2.CFrame*CF(4*i,8,3)*CFA(0,0,-10*i)*CF(0,6,0)).p;
  401.         (Torso2.CFrame*CF(2*i,8,4)*CFA(20,0,0)*CF(0,6,0)).p;
  402.         (Torso2.CFrame*CF(2*i,16.5+0.5,3)).p;}
  403.  
  404.  
  405.  
  406.  
  407. end
  408.  
  409. --roof designs
  410. newWeld(Torso,Torso2,newPart(9,1,1,mech,nil,"Wedge"),CF(0,17.5,-1.5))
  411. newWeld(Torso,Torso2,newPart(4.4,1,2,mech,nil,"Wedge"),CF(0,17.5,-2))
  412. newWeld(Torso,Torso2,newPart(4.4,1,4,mech,nil,"Wedge"),CF(0,18.5, 1))
  413. newWeld(Torso,Torso2,newPart(4.4,2,3,mech,nil,"Wedge"),CF(0,18, 4.5)*CFA(0,180,0))
  414. newWeld(Torso,Torso2,newPart(9,1,4,mech,nil),CF(0,17.5, 1))
  415. newWeld(Torso,Torso2,newPart(4.4,3,3.3,mech,nil,"Wedge"),CF(0,17-1.65, 4.5)*CFA(-90,0,0))
  416.  
  417. LShoulder = newPart(2.6,2.6,2.6,mech,nil,"Dark stone grey","Sphere")
  418. LShoulderW = newWeld6D(Torso2,Torso2,LShoulder,CF(-8,16,0),CF(0,0,0)*CFA(30,0,8))
  419. RShoulder = newPart(2.6,2.6,2.6,mech,nil,"Dark stone grey","Sphere")
  420. RShoulderW = newWeld6D(Torso2,Torso2,RShoulder,CF( 8,16,0),CF(0,0,0)*CFA(30,0,-8))
  421.  
  422. BackBooster = {}
  423. for i=-1,1,2 do --back torso design
  424. local v = newPart(4,4,4,mech,nil,"CylinderMesh")
  425. newWeld(Torso,Torso2,v,CF(4.5*i,15.5,3.75)*CFA(-15,0,5*i))
  426. newWeld(Torso,v,newPart(3.65,2,3.65,mech,nil,"CylinderMesh"),CF(0,-2,0)*CFA(2,0,0)*CF(0,0,0))
  427. 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))
  428. local backboost = newPart(2.4,0.2,2.4,mech,nil,"CylinderMesh","Really black","Neon")
  429. newWeld(Torso,v,backboost,CF(0,-2,0)*CFA(4,0,0)*CF(0,-2.91,0.1))
  430. BackBooster[i] = newI{"ParticleEmitter",backboost
  431. ,Lifetime = NumberRange.new(0.8,1)
  432. ,LightEmission=1
  433. ,Color = ColorSequence.new(Color3.new(178/255,248/255,255/255),Color3.new(0/255,0/255,255/255))
  434. ,Texture = assetprefix.."346519018"
  435. ,LockedToPart=true
  436. ,EmissionDirection="Bottom"
  437. ,Rate=600
  438. ,Speed = NumberRange.new(6,6)
  439. ,Rotation = NumberRange.new(-180,-180)
  440. ,RotSpeed = NumberRange.new(-90,-90)
  441. ,VelocitySpread=0
  442. ,Acceleration=V3(0,-15,0)
  443. ,Enabled=false
  444. }
  445.     for y=1,6 do
  446.         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))
  447.     end
  448. end
  449.  
  450.  
  451. for i,v in pairs{[-1]=LShoulder,[1]=RShoulder} do
  452.     newWeld(Torso,v,newPart(3,0.75,3,mech,nil,"CylinderMesh"),CFA(0,0, 50)) --x
  453.     newWeld(Torso,v,newPart(3,0.75,3,mech,nil,"CylinderMesh"),CFA(0,0,-50)) --x
  454.     newWeld(Torso,Torso2,newPart(6,2.5,2,mech,nil,"Torso"),CF(-5.5*i,17-0.25,0)*CFA(0,90,0)) --shoulder
  455.     newWeld(Torso,Torso2,newPart(4.5,2.5,3,mech,nil,"Torso"),CF(-8*i,17+0.5,0)*CFA(0,90,0))
  456.  
  457.     newWeld(Torso,Torso2,newPart(1.6,2,2,mech,nil,"Wedge"),CF(-5.5*i,14.5, 1.5)*CFA(180,90*i,0))
  458.     newWeld(Torso,Torso2,newPart(1.6,2,2,mech,nil,"Wedge"),CF(-5.5*i,14.5,-1.5)*CFA(180,90*i,0))
  459.     newWeld(Torso,Torso2,newPart(5,3,2.5,mech,nil,"Wedge"),CF(-3.5*i,15.5,0.5)*CFA(180,-90*i,0))
  460.  
  461.     newWeld(Torso,Torso2,newPart(4.3,2.5,3,mech,nil,"Wedge"),CF(-4.35*i,16.75,3.5)*CFA(180,0,0))
  462.  
  463.  
  464.     newWeld(Torso,v,newPart(3,1,3,mech,nil,"Wedge"),CF(0,-11.5,  1)*CFA(180,0,  0))
  465.     newWeld(Torso,v,newPart(3,2,1,mech,nil,"Wedge"),CF(0,-11  , -1)*CFA(  0,0,180))
  466.     newWeld(Torso,v,newPart(3,1,3,mech,nil,"Wedge"),CF(0,-10.5,  1)*CFA(  0,180,0))
  467.  
  468.     newWeld(Torso,v,newPart(2.8,1,2.2,mech,nil,"Wedge"),CF(0,-2.5,0.6)*CFA(180,0,  0))
  469.     newWeld(Torso,v,newPart(2.8,2,1,mech,nil,"Wedge"),CF(0,-2  , -1)*CFA( 180,180,180))
  470.     newWeld(Torso,v,newPart(2.8,1,2.2,mech,nil,"Wedge"),CF(0,-1.5,0.6)*CFA(  0,180,0))
  471.     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))
  472.     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))
  473.  
  474.     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
  475.     newWeld(Torso,v,newPart(3,0.2,3,mech,nil,"CylinderMesh"),CF(-1.5*i,-4,2)*CFA(0,0,90))
  476.     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))
  477.     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))
  478.     newWeld(Torso,v,newPart(1.5,1.6,1.5,mech,nil,"CylinderMesh","Black"),CF(0.7*i,-4,2)*CFA(0,0,90))
  479.     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))
  480.     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))
  481.     for x=50,110,30 do
  482.     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))
  483.     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))
  484.     end
  485.     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))
  486.     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))
  487.     newWeld(Torso,v,newPart(1.4,6,2.3,mech,nil),CF(-0.7*i,-7,0.8))
  488.  
  489.     newWeld(Torso,v,newPart(4.2,2,3,mech,nil,"Torso"),CF(0,-9.55,0.75)*CFA(14,90,0))
  490.  
  491. end
  492.  
  493. LElbow = newPart(1,1,1,mech,nil)
  494. LElbowW = newWeld6D(LShoulder,LShoulder,LElbow,CF(0,-12,0),CF(0,0,0)*CFA(-90,0,0))
  495. RElbow = newPart(1,1,1,mech,nil)
  496. RElbowW = newWeld6D(RShoulder,RShoulder,RElbow,CF(0,-12,0),CF(0,0,0)*CFA(-90-10,0,0))
  497.  
  498. for i,v in pairs{[-1]=LElbow,[1]=RElbow} do
  499.     newWeld(Torso,v,newPart(2.4,3.5,2.4,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,0,0)*CFA(0,0,90))
  500.     newWeld(Torso,v,newPart(1.7,3.8,1.7,mech,nil,"CylinderMesh","Black"),CF(0,0,0)*CFA(0,0,90))
  501.     newWeld(Torso,v,newPart(3,0.6,3,mech,nil,"CylinderMesh","Really black"),CF(0,0,0)*CFA(0,0,90))
  502.     if i == -1 then
  503.     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
  504.     newWeld(Torso,v,newPart(1.4,2,1,mech,nil,"Dark stone grey"),CF(0,-1,0))
  505.  
  506.     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))
  507.     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))
  508.  
  509.     newWeld(Torso,v,newPart(2,2.2,2,mech,nil,"Wedge"),CF(0,-1.9,-1.5))
  510.     newWeld(Torso,v,newPart(3,1,2,mech,nil),CF(0,-2.5,0))
  511.  
  512.     end
  513. end
  514.  
  515. --Left Arm
  516. newWeld(Torso,LElbow,newPart(3,3.5,4,mech,nil,"Wedge"),CF(0,-3-2,-0.75)*CFA(-90,0,0))
  517. newWeld(Torso,LElbow,newPart(5,4,5,mech,nil,"CylinderMesh","Dark stone grey"),CF(0,-3-2.5,0)*CFA(0,0,90))
  518. 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))
  519. newWeld(Torso,LElbow,newPart(4,1.2,4,mech,nil,"CylinderMesh","Black"),CF(0,-3-2.5+1,-1)*CFA(0,0,90))
  520. --newWeld(Torso,LElbow,newPart(4.99,2.3,1.1,mech,nil,"Dark stone grey"),CF(0,-3-2.5-0.5,0))
  521. for i=-1,1,2 do
  522.     newWeld(Torso,LElbow,newPart(1,4,4,mech,nil,"Sphere"),CF(2*i,-3-2.5,0)*CFA(0,0,0))
  523.     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))
  524. end
  525. newWeld(Torso,LElbow,newPart(2.6,6,2.6,mech,nil),CF(0,-3-5-1,0)) --
  526. newWeld(Torso,LElbow,newPart(3.5,6,1.1,mech,nil,"Dark stone grey"),CF(0,-3-5-1,0))
  527. 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))
  528. 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))
  529. 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))
  530. newWeld(Torso,LElbow,newPart(1.4,4,1,mech,nil,"Dark stone grey"),CF(0,-3-5-3.5+2,1.3))
  531. 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))
  532. newWeld(Torso,LElbow,newPart(2,3,2,mech,nil,"Dark stone grey","CylinderMesh"),CF(0,-3-5,-2.2+1))
  533. newWeld(Torso,LElbow,newPart(2.5,3,2.5,mech,nil,"Dark stone grey","CylinderMesh"),CF(0,-3-3.5,-2.2+1))
  534. 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))
  535. newWeld(Torso,LElbow,newPart(2.6,1,1,mech,nil),CF(0,-3-2.5,-2.5-0.5+0.2))
  536. 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))
  537.  
  538. LeftGunUse = false
  539. LeftGun = newPart(4,1,4,mech,nil,"CylinderMesh","Dark stone grey")
  540. LeftGunW = newWeld(Torso,LElbow,LeftGun,CF(0,-3-5-4.5,0)*CFA(0,0,0))
  541. newWeld(Torso,LeftGun,newPart(1.6,1,1.6,mech,nil,"Dark stone grey"),CF(0,-1,0))
  542. LeftGunSmoke = newI{"Smoke",LeftGun,Color=Color3.new(20/255,20/255,20/255),Opacity=0.5,Enabled=false,RiseVelocity=-10,Size=2}
  543. for i=120,360,120 do
  544. 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))
  545. 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)
  546. 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))
  547. local ghole = newPart(1.75,0.5,1.75,mech,nil,"Really black","Sphere","Neon")
  548. newWeld(Torso,LeftGun,ghole,CF(0,-1.5-2-0.5,0)*CFA(0,i,0)*CF(0,0,-2+0.85)) -- gun hole
  549. end
  550.  
  551. --Right Arm
  552. local of1 = 2
  553. local of2 = -5.2
  554. newWeld(Torso,RElbow,newPart(3.5,3,2.4,mech,nil,"Dark stone grey"),CFA(-55,0,0)*CF( 0,-1.5,0))
  555. newWeld(Torso,RElbow,newPart(3,4,3,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0,of2+3.5,of1)*CFA(0,0,90))
  556. newWeld(Torso,RElbow,newPart(7,1,2,mech,nil,"Torso"),CF( 0,of2-1,of1-1.5-1.5)*CFA(-90,90,0))
  557. newWeld(Torso,RElbow,newPart(5,0.5,1,mech,nil,"Torso"),CF( 0,of2-5,of1-1.5-1.25)*CFA(-90,90,0))
  558. 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))
  559. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(0,of2-3-3,of1-1.5-0.5)) --upper long
  560. 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))
  561. 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))
  562. newWeld(Torso,RElbow,newPart(2,18,1,mech,nil),CF(0,of2-3-3,of1+1.5+0.5)) --lower long
  563. 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))
  564. 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))
  565. newWeld(Torso,RElbow,newPart(3.4,2,4,mech,nil,"Wedge"),CF( 0,of2+1,of1-1.5)*CFA(-90,0,180))
  566. newWeld(Torso,RElbow,newPart(3.4,4,2,mech,nil,"Wedge"),CF( 0,of2+1,of1+1.5)*CFA(  0,0,180))
  567. newWeld(Torso,RElbow,newPart(1.7,2,1.7,mech,nil,"CylinderMesh","Dark stone grey"),CF( 0,of2+2,of1)*CFA(  0,0,180))
  568. newWeld(Torso,RElbow,newPart(1.3,2.01,1.3,mech,nil,"CylinderMesh","Really black"),CF( 0,of2+2,of1)*CFA(  0,0,180))
  569.  
  570.  
  571. newWeld(Torso,RElbow,newPart(3.4,1,5,mech,nil),CF( 0,of2+3.5,of1)*CFA(  0,0,180))
  572. newWeld(Torso,RElbow,newPart(3.4,1,5,mech,nil,"Wedge"),CF( 0,of2+1.5,of1+3)*CFA(-90,0,180))
  573. newWeld(Torso,RElbow,newPart(3.4,2,2,mech,nil,"Wedge"),CF( 0,of2+5,of1-1.5)*CFA(0,0,0))
  574. newWeld(Torso,RElbow,newPart(3.4,2,4,mech,nil,"Wedge"),CF( 0,of2+5,of1+1.5)*CFA(0,180,0))
  575.  
  576. 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))
  577. for x=60,360,60 do
  578.     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))
  579. end
  580. 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))
  581. for i=-1,1,2 do
  582.     newWeld(Torso,RElbow,newPart(0.6,0.25,1.6,mech,nil,"Black"),CF(1.2*i,of2-14,of1))
  583.     for ii=1,10 do
  584.         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))
  585.     end
  586. end
  587.  
  588.  
  589. Hatch = newPart(4,6,0.2,mech,nil)
  590. HatchW = newWeld6D(Torso2,Torso2,Hatch,CF(0,11-3,4),CF(0,-3,-0.1)*CFA(-20,0,0)) -- x is -20
  591. 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))
  592.  
  593. Seat = newI{"Seat",mech,Name="Seat",formFactor="Symmetric",Size=V3(2,1,2),TopSurface="SmoothNoOutlines"}
  594. SeatW = newWeld6D(Torso2,Torso2,Seat,CF(0,8.5,0))
  595. newWeld(Torso,Seat,newPart(2,1,1,mech,nil,"Wedge"),CF(0,0,-1.5))
  596. newWeld(Torso,Seat,newPart(2,2.6,0.8,mech,nil),CF(0,0.5+1.15,0.8)*CFA(10,0,0))
  597. newWeld(Torso,Seat,newPart(2,1.2,0.8,mech,nil),CF(0,0.5+2.9,1)*CFA(0,0,0))
  598.  
  599.  
  600. Head = newPart(1,1,1,mech,nil,"nonCollide","Transparent")
  601. Head.Name="Head"
  602. HeadW = newWeld(Torso,Torso,Head,CF(0,2,0))
  603.  
  604. for i,v in pairs(CockpitGlass) do
  605.     v.Transparency = 0.6
  606. end
  607. CockpitGlassD = false
  608. for i,v in pairs(mech:children()) do
  609.     if v:IsA'BasePart' and v.Material==Enum.Material.SmoothPlastic and v.Transparency==0 then
  610.         v.Material="Metal"
  611.     end
  612. end
  613.  
  614. Base.Name="HumanoidRootPart" BaseW.Name = "Root Hip"
  615. Torso.Name="Torso"
  616. Torso1.Name = "LowerTorso" Torso1W.Name = "Lower Hip"
  617. Torso2.Name = "UpperTorso" Torso2W.Name = "Upper Hip"
  618. LThigh.Name =  "LeftThigh" LThighW.Name = "LThigh"
  619. RThigh.Name = "RightThigh" RThighW.Name = "RThigh"
  620. LLeg.Name   =    "LeftLeg" LLegW.Name   = "LLeg"
  621. RLeg.Name   =   "RightLeg" RLegW.Name   = "RLeg"
  622. LFoot.Name  =   "LeftFoot" LFootW.Name  = "LFoot"
  623. RFoot.Name  =  "RightFoot" RFootW.Name  = "RFoot"
  624. LToe.Name   =    "LeftToe" LToeW.Name   = "LToe"
  625. RToe.Name   =   "RightToe" RToeW.Name   = "RToe"
  626. LShoulder.Name =  "LeftShoulder" LShoulderW.Name = "LShoulder"
  627. RShoulder.Name = "RightShoulder" RShoulderW.Name = "RShoulder"
  628. LElbow.Name =  "LeftElbow" LElbowW.Name = "LElbow"
  629. RElbow.Name = "RightElbow" RElbowW.Name = "RElbow"
  630. Hatch.Name  =       "Hatch" HatchW.Name  = "Hatch"
  631. SeatW.Name="Seat"
  632.  
  633.  
  634. ----
  635. checkGroundTouch = function()
  636. local Hit1,Pos1 = ray(LToe.Position,LToe.CFrame*CF(0,-1,0).p-LToe.Position,mech,3)
  637. local Hit2,Pos2 = ray(RToe.Position,RToe.CFrame*CF(0,-1,0).p-RToe.Position,mech,3)
  638. if Hit1 or Hit2 then return 1 end
  639. return 0
  640. end
  641. ----
  642.  
  643. doAfterT = {}
  644. doAfter = function(t,f)
  645.     local key = (MRND(-100,100)*MRND(-100,100)).."a"..MRND(-999999,999999)
  646.     doAfterT[key] = {Time=t,Func=f,Current=0}
  647.     return key
  648. end
  649. doInT = {}
  650. doIn = function(t,f,f2)
  651.     local key = (MRND(-100,100)*MRND(-100,100)).."a"..MRND(-999999,999999)
  652.     doInT[key] = {Time=t,Func=f,FuncEnd=f2,Current=0}
  653.     return key
  654. end
  655.  
  656.  
  657. Motors = {["BaseW"]=BaseW,["Torso1W"]=Torso1W,["Torso2W"]=Torso2W,["LThighW"]=LThighW,["RThighW"]=RThighW,["LLegW"]=LLegW,["RLegW"]=RLegW,["LFootW"]=LFootW,["RFootW"]=RFootW,["LToeW"]=LToeW,["RToeW"]=RToeW,
  658.           ["LShoulderW"]=LShoulderW,["RShoulderW"]=RShoulderW,["LElbowW"]=LElbowW,["RElbowW"]=RElbowW,["HatchW"]=HatchW,["SeatW"]=SeatW}
  659.  
  660. print(#mech:getChildren().." Parts")
  661. _G.mech = mech
  662. _G.RMM2 = getfenv()
  663. _G.m = _G.RMM2
  664.  
  665. gw = function()
  666.     print(" ")
  667.     for i,weldn in pairs{"LThighW","LLegW","LFootW","LToeW","RThighW","RLegW","RFootW","RToeW","LShoulderW","LElbowW","RShoulderW","RElbowW","BaseW","Torso1W","Torso2W","HatchW","SeatW"} do
  668.         weld = getfenv()[weldn]
  669.         local a,b,c = weld.C0:toEulerAnglesXYZ()
  670.         local d,e,f = weld.C1:toEulerAnglesXYZ()
  671.         inde = function(n)
  672.             n = math.floor(n*1000+0.5)/1000
  673.             return string.rep(" ",5-#(""..n))..n
  674.         end
  675.         --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))..")")
  676.         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)).."})")
  677.     end
  678.     print(" ")
  679. end
  680. gwBool = newI{"BoolValue",mech,Name="GetWelds"}
  681. gwBool.Changed:connect(function()
  682.     if not gwBool.Value then return end
  683.     gwBool.Value=false
  684.     gw()
  685. end)
  686. gw2 = function()
  687.     print(" ")
  688.     for i,weldn in pairs{"LS","RS","LH","RH"} do
  689.         weld = getfenv()[weldn]
  690.         local a,b,c = weld.C0:toEulerAnglesXYZ()
  691.         local d,e,f = weld.C1:toEulerAnglesXYZ()
  692.         inde = function(n)
  693.             n = math.floor(n*1000+0.5)/1000
  694.             return string.rep(" ",5-#(""..n))..n
  695.         end
  696.         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)).."})")
  697.         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)).."})")
  698.     end
  699.     print(" ")
  700. end
  701. ------
  702. Anims = {} -- {WELD,C0or1,Time,CFStart,CFEnd,Current}
  703. addAnim = function(weld,C0or1,Time,CFStart,CFEnd)
  704.     if not weld then return end
  705.     local CC = "C"..C0or1
  706.     if not CFStart then
  707.         local a,b,c = weld[CC]:toEulerAnglesXYZ()
  708.         CFStart = {weld[CC].x,weld[CC].y,weld[CC].z,MD(a),MD(b),MD(c)}
  709.     end
  710.     if not CFEnd[1] and not CFEnd[2] and not CFEnd[3] then
  711.         CFEnd[1] = weld[CC].x
  712.         CFEnd[2] = weld[CC].y
  713.         CFEnd[3] = weld[CC].z
  714.     end
  715.     Anims[weld.Name..CC] = {weld=weld,CC="C"..C0or1,CFStart=CFStart,CFEnd=CFEnd,Time=Time,Current=0}
  716. end
  717. --
  718. WalkKey = {}
  719. loadAnim = {} _G.la = loadAnim
  720. --
  721. ClearWalk = function()
  722.     for i,v in pairs(WalkKey) do
  723.         doAfterT[i] = nil
  724.         WalkKey[i] = nil
  725.     end
  726. end
  727. --
  728. loadAnim.Open = function(a,t)
  729.     t = t or 1.5
  730.     addAnim(LThighW   ,1,t,nil,{nil,nil,nil, -75,   0,   0})
  731.     addAnim(LLegW     ,1,t,nil,{nil,nil,nil, 155,   0,   0})
  732.     addAnim(LFootW    ,1,t,nil,{nil,nil,nil, -80,   0,   0})
  733.     addAnim(LToeW     ,1,t,nil,{nil,nil,nil,   0,   0,   0})
  734.     addAnim(RThighW   ,1,t,nil,{nil,nil,nil, -75,   0,   0})
  735.     addAnim(RLegW     ,1,t,nil,{nil,nil,nil, 155,   0,   0})
  736.     addAnim(RFootW    ,1,t,nil,{nil,nil,nil, -80,   0,   0})
  737.     addAnim(RToeW     ,1,t,nil,{nil,nil,nil,   0,   0,   0})
  738.     addAnim(LShoulderW,1,t,nil,{nil,nil,nil,  20,   0,   8})
  739.     addAnim(LElbowW   ,1,t,nil,{nil,nil,nil, -90,   0,   0})
  740.     addAnim(RShoulderW,1,t,nil,{nil,nil,nil, -20,   0,  -8})
  741.     addAnim(RElbowW   ,1,t,nil,{nil,nil,nil, -60,   0,   0})
  742.     addAnim(BaseW     ,1,t,nil,{  0,10.2-10.2, 0,   0,   0,   0})
  743.     addAnim(Torso1W   ,1,t,nil,{nil,nil,nil,   0,   0,   0})
  744.     addAnim(Torso2W   ,1,t,nil,{nil,nil,nil,   0,   0,   0})
  745.     addAnim(HatchW    ,1,t,nil,{nil,nil,nil,-180,   0,   0})
  746.     addAnim(SeatW     ,0,t,nil,{-0.6,8.5, 5,  0,  180,   0})
  747.     doAfter(t,function() addAnim(SeatW     ,0,t*0.5,nil,{    0,    -1,    5.3,    0,    180,    0}) end)
  748. end
  749. loadAnim.Close = function(a,t)
  750.     addAnim(SeatW     ,0,t*0.5,nil,{    -0.6,    8.5,    5,    0,    180,    0})
  751.     doAfter(t*0.5,function() loadAnim:Standing(1) end)
  752. end
  753. loadAnim.Standing = function(a,t)
  754.     t = t or 1
  755.     addAnim(LThighW   ,1,t,nil,{  1.5,  0.5,    0,  -25,    0,    0})
  756.     addAnim(LLegW     ,1,t,nil,{    0,    0,    0,   75,    0,    0})
  757.     addAnim(LFootW    ,1,t,nil,{    0,    0,    0,   10,    0,    0})
  758.     addAnim(LToeW     ,1,t,nil,{    0,    0,    0,  -60,    0,    0})
  759.     addAnim(RThighW   ,1,t,nil,{ -1.5,  0.5,    0,  -25,    0,    0})
  760.     addAnim(RLegW     ,1,t,nil,{    0,    0,    0,   75,    0,    0})
  761.     addAnim(RFootW    ,1,t,nil,{    0,    0,    0,   10,    0,    0})
  762.     addAnim(RToeW     ,1,t,nil,{    0,    0,    0,  -60,    0,    0})
  763.     addAnim(LShoulderW,1,t,nil,{    0,    0,    0,   30,    0,    8})
  764.     addAnim(LElbowW   ,1,t,nil,{    0,    0,    0,  -90,    0,    0})
  765.     addAnim(RShoulderW,1,t,nil,{    0,    0,    0,   30,    0,   -8})
  766.     addAnim(RElbowW   ,1,t,nil,{    0,    0,    0, -100,    0,    0})
  767.     addAnim(BaseW     ,1,t,nil,{    0,    0,    0,    0,    0,    0})
  768.     addAnim(Torso1W   ,1,t,nil,{    0,    0,    0,    0,    0,    0})
  769.     addAnim(Torso2W   ,1,t,nil,{    0,    0,    0,    0,    0,    0})
  770.     addAnim(HatchW    ,1,t,nil,{    0,   -3, -0.1,  -20,    0,    0})
  771.     addAnim(SeatW     ,0,t,nil,{    0,  8.5,    0,    0,    0,    0})
  772. end
  773. loadAnim.ReturnLeg = function(a,t)
  774.     t = t or 0.5
  775.     addAnim(LThighW   ,1,t,nil,{  1.5,  0.5,    0,  -25,    0,    0})
  776.     addAnim(LLegW     ,1,t,nil,{    0,    0,    0,   75,    0,    0})
  777.     addAnim(LFootW    ,1,t,nil,{    0,    0,    0,   10,    0,    0})
  778.     addAnim(LToeW     ,1,t,nil,{    0,    0,    0,  -60,    0,    0})
  779.     addAnim(RThighW   ,1,t,nil,{ -1.5,  0.5,    0,  -25,    0,    0})
  780.     addAnim(RLegW     ,1,t,nil,{    0,    0,    0,   75,    0,    0})
  781.     addAnim(RFootW    ,1,t,nil,{    0,    0,    0,   10,    0,    0})
  782.     addAnim(RToeW     ,1,t,nil,{    0,    0,    0,  -60,    0,    0})
  783. end
  784. loadAnim.ReturnArm = function(a,t)
  785.     t = t or 0.5
  786.     addAnim(LShoulderW,1,t,nil,{    0,    0,    0,   30,    0,    8})
  787.     addAnim(LElbowW   ,1,t,nil,{    0,    0,    0,  -90,    0,    0})
  788.     addAnim(RShoulderW,1,t,nil,{    0,    0,    0,   30,    0,   -8})
  789.     addAnim(RElbowW   ,1,t,nil,{    0,    0,    0, -100,    0,    0})
  790. end
  791. loadAnim.WalkL = function(a,t)
  792.     local WalkSpeed = 0.3
  793.     local tu = Turn==0 and 0 or (Turn0 then
  794.         AnimLegs,AnimArms,AnimTorso=false,false,false
  795.         ClearWalk()
  796.         loadAnim:Jump()
  797.         wait(0.5)
  798.         AnimTorso=true
  799.         AnimArms=true
  800.         veloym = 10000000
  801.         loadAnim:ReturnArm(0.3)
  802.         if Key.c then BackBooster[-1].Enabled = true BackBooster[1].Enabled = true veloy = 100 wait(1) else veloy = 75 wait(0.5) end
  803.         BackBooster[-1].Enabled = false BackBooster[1].Enabled = false
  804.         veloym = 0
  805.         veloy = 0
  806.         AnimLegs=true
  807.         if WalkDir==0 then loadAnim:ReturnLeg() end
  808.     elseif k=="p" and not CockpitGlassD and Pilot then
  809.         CockpitGlassD = true
  810.         if CockpitGlass[1].Transparency==0 then
  811.             doIn(0.7,function(i)
  812.                 for x,v in pairs(CockpitGlass) do
  813.                     v.Transparency = 0.6*i
  814.                 end
  815.             end)
  816.         else
  817.             doIn(0.7,function(i)
  818.                 for x,v in pairs(CockpitGlass) do
  819.                     v.Transparency = 0.6-0.6*i
  820.                 end
  821.             end)
  822.         end
  823.         wait(0.8)
  824.         CockpitGlassD = false
  825.     elseif k =="q" and not LeftGunUse then
  826.         LeftGunUse=true
  827.         if not spinSpeed then spinSpeed=0 end
  828.         for i=1,50 do
  829.             if spinSpeed>40 then spinSpeed=40 end
  830.             LeftGunW.C1=LeftGunW.C1*CFA(0,spinSpeed,0)
  831.             spinSpeed=spinSpeed+0.7
  832.             if i%2==0 then PlaySound(assets.Minigun1,LeftGun,0.4+0.8*spinSpeed/40,1) end
  833.             wait()
  834.         end
  835.         local co=0
  836.         LeftGunSmoke.Enabled=true
  837.         local muzzleFlash = newPart(1,1,1,mech,nil,"Transparent","New Yeller")
  838.         newI{"SpecialMesh",muzzleFlash,MeshType="FileMesh",MeshId=assets.MuzzleFlash,Scale=V3(0.8,3,0.8)}
  839.         local muzzleW = newWeld(LeftGun,LeftGun,muzzleFlash,CF(0,0,0))
  840.         repeat
  841.             co=co+1
  842.             LeftGunW.C1=LeftGunW.C1*CFA(0,spinSpeed,0)
  843.             if co%2==0 then PlaySound(assets.Minigun1,LeftGun,1.2,1) end
  844.             if co%2==0 then
  845.                 muzzleFlash.Transparency = 0.5
  846.                 PlaySound(assets.Fire1,LeftGun,MRND(600,950)/1000,0.4)
  847.                 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'}
  848.                 newI{"CylinderMesh",bullet}
  849.                 local rotRand = MRND(1,3)*120
  850.                 bullet.CFrame=LeftGun.CFrame*CF(0,-6+2,0)*CFA(0,rotRand,0)*CF(0,0,-2+0.85)
  851.                 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)
  852.                 muzzleW.C0 = CF(0,-6-2,0)*CFA(0,rotRand,0)*CF(0,0,-2+0.85)*CFA(180,0,0)
  853.             else
  854.                 muzzleFlash.Transparency=1
  855.             end
  856.             wait()
  857.         until not Key.q
  858.         muzzleFlash:Destroy()
  859.         LeftGunSmoke.Enabled=false
  860.         LeftGunUse=false
  861.         for i=50,1,-0.5 do
  862.             if LeftGunUse then break end
  863.             if spinSpeed40 then x = 40 end
  864.         if x<-120 then x = -120 end
  865.         addAnim(LElbowW   ,1,0.5,nil,{  nil,    0,  nil,    -120-x, 0,    0})
  866.         if x<-60 then x = -60 end
  867.          addAnim(RElbowW   ,1,0.5,nil,{  nil,    0,  nil,    -120-x, 0,    0})
  868.     end
  869.     --
  870.     if runcount%5==0 and Turn~=0 and Movement and Pilot then
  871.         local turntarg = Base.CFrame*CFA(0,Turn,0)*CF(0,0,-1)
  872.         Gyro.cframe = CF(V3(Base.Position.x,0,Base.Position.z),V3(turntarg.x,0,turntarg.z))
  873.     end
  874.     --
  875.     if Key.w and not Key.s and Movement and Pilot and WalkDir==1 then
  876.         Velo.maxForce = V3(10000000,veloym,10000000)
  877.         local velo = Base.CFrame.lookVector*WalkingSpeed
  878.         Velo.Velocity = V3(velo.x,veloy,velo.z)
  879.     elseif Key.s and not Key.w and Movement and Pilot and WalkDir==-1 then
  880.         Velo.maxForce = V3(10000000,veloym,10000000)
  881.         local velo = Base.CFrame.lookVector*-12
  882.         Velo.Velocity = V3(velo.x,veloy,velo.z)
  883.     else
  884.         Velo.maxForce = V3(10000000,veloym,10000000)
  885.         Velo.Velocity = V3(0,veloy,0)
  886.     end
  887.     --
  888.     for i,anim in pairs(Anims) do
  889.         anim.Current = anim.Current + step
  890.         local CFStart = CF(anim.CFStart[1],anim.CFStart[2],anim.CFStart[3])*CFA(anim.CFStart[4],anim.CFStart[5],anim.CFStart[6])
  891.         local CFEnd   = CF(  anim.CFEnd[1],  anim.CFEnd[2],  anim.CFEnd[3])*CFA(  anim.CFEnd[4],  anim.CFEnd[5],  anim.CFEnd[6])
  892.         anim.weld[anim.CC] = CFStart:lerp(CFEnd,anim.Current/anim.Time)
  893.         --print(anim.Current)
  894.         if anim.Current>=anim.Time then
  895.             anim.weld[anim.CC] = CFEnd -- 100%
  896.             Anims[i]=nil
  897.         end
  898.     end
  899.     --
  900.     for i,v in pairs(doAfterT) do
  901.         v.Current = v.Current + step
  902.         if v.Current>=v.Time then
  903.             v.Func()
  904.             doAfterT[i] = nil
  905.         end
  906.     end
  907.     --
  908.     for i,v in pairs(doInT) do
  909.         v.Current = v.Current + step
  910.         if v.Current>v.Time then v.Current = v.Time end -- sometimes exceeds
  911.         v.Func(v.Current/v.Time,i,step)
  912.         if doInT[i] and v.Current>=v.Time then
  913.             if v.FuncEnd then v.FuncEnd() end
  914.             doInT[i] = nil
  915.         end
  916.     end
  917.     --
  918. end)
  919. loadAnim:Open(0.2)
  920. Anim = "Opened"
  921. mech:MoveTo((CTorso.CFrame*CF(0,0,-30)).p)
  922.  
  923. --(CTorso.CFrame*CF(0,0,-16)).p)
  924. -- hl/https://preview.c9users.io/jaspher/rbx_stoof/RMMech.lua  
  925. -- l/_G.m.addAnim(_G.m.BaseW     ,1,1,nil,{    0,    0,    0,    90,    0,    0})
  926. -- l/_G.m.addAnim(_G.m.LThighW,1,1,nil,{1.5,0.5,0,-25,0,45})
  927. -- l/_G.la:Open()  l/_G.la:Standing()
  928. -- c/for i,v in pairs(workspace.notrmdx["RM Mech 2"]:children()) do if v:IsA'BasePart' then v:SetNetworkOwner(game.Players.notrmdx) end end -- jew



  • Recent Roblox Scripts