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