Advertisement
ghostteen14

Untitled

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