Advertisement
seasee54u

Untitled

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