pork0

Untitled

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