SHOW:
|
|
- or go back to the newest paste.
1 | ---------------------------------------------------------------Lol--------------------------------------------------------------- | |
2 | Driver = nil | |
3 | ||
4 | Wrecked = false | |
5 | Health = 1000000 | |
6 | MaxHealth = 1000000 | |
7 | ToughnessMinorDamage = 150 | |
8 | ToughnessMajorDamage = 250 | |
9 | ||
10 | DriftCheck = 0 | |
11 | - | Drifting = false |
11 | + | Drifting = true |
12 | DriftAcceleration = 0.001 | |
13 | DriftSteerDifficulty = 0.05 | |
14 | DriftSteerPower = 20 | |
15 | ||
16 | ThrottlePercent = 0 | |
17 | Acceleration = 0.004 | |
18 | - | TopSpeed = 150 |
18 | + | TopSpeed = 200 |
19 | Deceleration = 0.008 | |
20 | BrakePower = 0.009 | |
21 | IsBraking = false | |
22 | ||
23 | SteerPercent = 0 | |
24 | SteerDifficulty = 0.05 | |
25 | SteerPower = 15 | |
26 | ||
27 | TireFriction = 0.3 | |
28 | TireElasticity = 0.9 | |
29 | ||
30 | MasterColor = BrickColor.new("Really black") | |
31 | ||
32 | Vehicle = Instance.new("Model") | |
33 | Vehicle.Name = "Car" | |
34 | Vehicle.Parent = game:GetService("Workspace") | |
35 | --damn | |
36 | Base = Instance.new("Part") | |
37 | Base.Name = "VehicleBase" | |
38 | Base.BrickColor = MasterColor | |
39 | Base.TopSurface = "Smooth" | |
40 | Base.BottomSurface = "Smooth" | |
41 | Base.formFactor = "Symmetric" | |
42 | Base.Size = Vector3.new(8, 3, 17) | |
43 | Base.Friction = 1 | |
44 | Base.Elasticity = 0 | |
45 | Base.Parent = Vehicle | |
46 | Thrust = Instance.new("BodyVelocity") | |
47 | Thrust.P = 100 | |
48 | Thrust.maxForce = Vector3.new(math.huge, 0, math.huge) | |
49 | Thrust.velocity = Vector3.new() | |
50 | Thrust.Parent = Base | |
51 | Steer = Instance.new("BodyGyro") | |
52 | Steer.maxTorque = Vector3.new(0, math.huge, 0) | |
53 | Steer.cframe = CFrame.new() | |
54 | Steer.P = 7500 | |
55 | Steer.Parent = Base | |
56 | ||
57 | Seat = Instance.new("VehicleSeat") | |
58 | Seat.CanCollide = false | |
59 | Seat.MaxSpeed = 0 | |
60 | Seat.Torque = 0 | |
61 | Seat.HeadsUpDisplay = false | |
62 | Seat.BrickColor = BrickColor.new("Lime green") | |
63 | Seat.TopSurface = "Smooth" | |
64 | Seat.BottomSurface = "Smooth" | |
65 | Seat.Size = Vector3.new(2, 1, 2) | |
66 | Seat.Parent = Vehicle | |
67 | Weld = Instance.new("Weld") | |
68 | Weld.Name = "Weld" | |
69 | Weld.Parent = Seat | |
70 | Weld.Part0 = Base | |
71 | Weld.Part1 = Seat | |
72 | Weld.C0 = CFrame.new(-2.5, 0.375, 0.25) | |
73 | ||
74 | Part = Instance.new("Part") | |
75 | Part.Name = "Front Left Seat Back" | |
76 | Part.BrickColor = BrickColor.new("Lime green") | |
77 | Part.TopSurface = "Smooth" | |
78 | Part.BottomSurface = "Smooth" | |
79 | Part.formFactor = "Symmetric" | |
80 | Part.Size = Vector3.new(2, 3, 1) | |
81 | Part.Parent = Vehicle | |
82 | Mesh = Instance.new("SpecialMesh") | |
83 | Mesh.MeshType = "Brick" | |
84 | Mesh.Scale = Vector3.new(1, 1, 1) | |
85 | Mesh.Parent = Part | |
86 | Weld = Instance.new("Weld") | |
87 | Weld.Parent = Part | |
88 | Weld.Part0 = Base | |
89 | Weld.Part1 = Part | |
90 | Weld.C0 = CFrame.new(-2.5, 1.5, 1.25) | |
91 | ||
92 | Part = Instance.new("Part") | |
93 | Part.Name = "Front Left Seat Headrest 1" | |
94 | Part.BrickColor = BrickColor.new("Lime green") | |
95 | Part.TopSurface = "Smooth" | |
96 | Part.BottomSurface = "Smooth" | |
97 | Part.formFactor = "Symmetric" | |
98 | Part.Size = Vector3.new(2, 1, 1) | |
99 | Part.Parent = Vehicle | |
100 | Mesh = Instance.new("SpecialMesh") | |
101 | Mesh.MeshType = "Brick" | |
102 | Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) | |
103 | Mesh.Parent = Part | |
104 | Weld = Instance.new("Weld") | |
105 | Weld.Parent = Part | |
106 | Weld.Part0 = Base | |
107 | Weld.Part1 = Part | |
108 | Weld.C0 = CFrame.new(-2.5, 3, 1.25) | |
109 | ||
110 | Part = Instance.new("Part") | |
111 | Part.Name = "Front Left Seat Headrest 2" | |
112 | Part.BrickColor = BrickColor.new("Lime green") | |
113 | Part.TopSurface = "Smooth" | |
114 | Part.BottomSurface = "Smooth" | |
115 | Part.formFactor = "Symmetric" | |
116 | Part.Size = Vector3.new(2, 1, 1) | |
117 | Part.Parent = Vehicle | |
118 | Mesh = Instance.new("SpecialMesh") | |
119 | Mesh.MeshType = "Brick" | |
120 | Mesh.Scale = Vector3.new(0.9, 1.1, 1) | |
121 | Mesh.Parent = Part | |
122 | Weld = Instance.new("Weld") | |
123 | Weld.Parent = Part | |
124 | Weld.Part0 = Base | |
125 | Weld.Part1 = Part | |
126 | Weld.C0 = CFrame.new(-2.5, 3.8, 1.25) | |
127 | ||
128 | Seat2 = Instance.new("VehicleSeat") | |
129 | Seat2.Name = "VehicleSeat2" | |
130 | Seat2.CanCollide = false | |
131 | Seat2.MaxSpeed = 0 | |
132 | Seat2.Torque = 0 | |
133 | Seat2.HeadsUpDisplay = false | |
134 | Seat2.BrickColor = BrickColor.new("Lime green") | |
135 | Seat2.TopSurface = "Smooth" | |
136 | Seat2.BottomSurface = "Smooth" | |
137 | Seat2.Size = Vector3.new(2, 1, 2) | |
138 | Seat2.Parent = Vehicle | |
139 | Weld = Instance.new("Weld") | |
140 | Weld.Parent = Seat2 | |
141 | Weld.Part0 = Base | |
142 | Weld.Part1 = Seat2 | |
143 | Weld.C0 = CFrame.new(2.5, 0.375, 0.5) | |
144 | ||
145 | Part = Instance.new("Part") | |
146 | Part.Name = "Front Right Seat Back" | |
147 | Part.BrickColor = BrickColor.new("Lime green") | |
148 | Part.TopSurface = "Smooth" | |
149 | Part.BottomSurface = "Smooth" | |
150 | Part.formFactor = "Symmetric" | |
151 | Part.Size = Vector3.new(2, 3, 1) | |
152 | Part.Parent = Vehicle | |
153 | Mesh = Instance.new("SpecialMesh") | |
154 | Mesh.MeshType = "Brick" | |
155 | Mesh.Scale = Vector3.new(1, 1, 1) | |
156 | Mesh.Parent = Part | |
157 | Weld = Instance.new("Weld") | |
158 | Weld.Parent = Part | |
159 | Weld.Part0 = Base | |
160 | Weld.Part1 = Part | |
161 | Weld.C0 = CFrame.new(2.5, 1.5, 1.25) | |
162 | ||
163 | Part = Instance.new("Part") | |
164 | Part.Name = "Front Right Seat Headrest 1" | |
165 | Part.BrickColor = BrickColor.new("Lime green") | |
166 | Part.TopSurface = "Smooth" | |
167 | Part.BottomSurface = "Smooth" | |
168 | Part.formFactor = "Symmetric" | |
169 | Part.Size = Vector3.new(2, 1, 1) | |
170 | Part.Parent = Vehicle | |
171 | Mesh = Instance.new("SpecialMesh") | |
172 | Mesh.MeshType = "Brick" | |
173 | Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) | |
174 | Mesh.Parent = Part | |
175 | Weld = Instance.new("Weld") | |
176 | Weld.Parent = Part | |
177 | Weld.Part0 = Base | |
178 | Weld.Part1 = Part | |
179 | Weld.C0 = CFrame.new(2.5, 3, 1.25) | |
180 | ||
181 | Part = Instance.new("Part") | |
182 | Part.Name = "Front Right Seat Headrest 2" | |
183 | Part.BrickColor = BrickColor.new("Lime green") | |
184 | Part.TopSurface = "Smooth" | |
185 | Part.BottomSurface = "Smooth" | |
186 | Part.formFactor = "Symmetric" | |
187 | Part.Size = Vector3.new(2, 1, 1) | |
188 | Part.Parent = Vehicle | |
189 | Mesh = Instance.new("SpecialMesh") | |
190 | Mesh.MeshType = "Brick" | |
191 | Mesh.Scale = Vector3.new(0.9, 1.1, 1) | |
192 | Mesh.Parent = Part | |
193 | Weld = Instance.new("Weld") | |
194 | Weld.Parent = Part | |
195 | Weld.Part0 = Base | |
196 | Weld.Part1 = Part | |
197 | Weld.C0 = CFrame.new(2.5, 3.8, 1.25) | |
198 | ||
199 | Seat3 = Instance.new("VehicleSeat") | |
200 | Seat3.Name = "VehicleSeat3" | |
201 | Seat3.CanCollide = false | |
202 | Seat3.MaxSpeed = 0 | |
203 | Seat3.Torque = 0 | |
204 | Seat3.HeadsUpDisplay = false | |
205 | Seat3.BrickColor = BrickColor.new("Lime green") | |
206 | Seat3.TopSurface = "Smooth" | |
207 | Seat3.BottomSurface = "Smooth" | |
208 | Seat3.Size = Vector3.new(2, 1, 2) | |
209 | Seat3.Parent = Vehicle | |
210 | Weld = Instance.new("Weld") | |
211 | Weld.Parent = Seat3 | |
212 | Weld.Part0 = Base | |
213 | Weld.Part1 = Seat3 | |
214 | Weld.C0 = CFrame.new(-2.5, 0.375, 4.5) | |
215 | ||
216 | Part = Instance.new("Part") | |
217 | Part.Name = "Rear Left Seat Back" | |
218 | Part.BrickColor = BrickColor.new("Lime green") | |
219 | Part.TopSurface = "Smooth" | |
220 | Part.BottomSurface = "Smooth" | |
221 | Part.formFactor = "Symmetric" | |
222 | Part.Size = Vector3.new(2, 3, 1) | |
223 | Part.Parent = Vehicle | |
224 | Mesh = Instance.new("SpecialMesh") | |
225 | Mesh.MeshType = "Brick" | |
226 | Mesh.Scale = Vector3.new(1, 1, 1) | |
227 | Mesh.Parent = Part | |
228 | Weld = Instance.new("Weld") | |
229 | Weld.Parent = Part | |
230 | Weld.Part0 = Base | |
231 | Weld.Part1 = Part | |
232 | Weld.C0 = CFrame.new(-2.5, 1.5, 5.25) | |
233 | ||
234 | Seat4 = Instance.new("VehicleSeat") | |
235 | Seat4.Name = "VehicleSeat4" | |
236 | Seat4.CanCollide = false | |
237 | Seat4.MaxSpeed = 0 | |
238 | Seat4.Torque = 0 | |
239 | Seat4.HeadsUpDisplay = false | |
240 | Seat4.BrickColor = BrickColor.new("Lime green") | |
241 | Seat4.TopSurface = "Smooth" | |
242 | Seat4.BottomSurface = "Smooth" | |
243 | Seat4.Size = Vector3.new(2, 1, 2) | |
244 | Seat4.Parent = Vehicle | |
245 | Weld = Instance.new("Weld") | |
246 | Weld.Parent = Seat4 | |
247 | Weld.Part0 = Base | |
248 | Weld.Part1 = Seat4 | |
249 | Weld.C0 = CFrame.new(2.5, 0.375, 4.5) | |
250 | ||
251 | Part = Instance.new("Part") | |
252 | Part.Name = "Rear Right Seat Back" | |
253 | Part.BrickColor = BrickColor.new("Lime green") | |
254 | Part.TopSurface = "Smooth" | |
255 | Part.BottomSurface = "Smooth" | |
256 | Part.formFactor = "Symmetric" | |
257 | Part.Size = Vector3.new(2, 3, 1) | |
258 | Part.Parent = Vehicle | |
259 | Mesh = Instance.new("SpecialMesh") | |
260 | Mesh.MeshType = "Brick" | |
261 | Mesh.Scale = Vector3.new(1, 1, 1) | |
262 | Mesh.Parent = Part | |
263 | Weld = Instance.new("Weld") | |
264 | Weld.Parent = Part | |
265 | Weld.Part0 = Base | |
266 | Weld.Part1 = Part | |
267 | Weld.C0 = CFrame.new(2.5, 1.5, 5.25) | |
268 | ||
269 | Part = Instance.new("Part") | |
270 | Part.Name = "Rear Center Seat" | |
271 | Part.BrickColor = BrickColor.new("Lime green") | |
272 | Part.TopSurface = "Smooth" | |
273 | Part.BottomSurface = "Smooth" | |
274 | Part.formFactor = "Symmetric" | |
275 | Part.Size = Vector3.new(3, 3, 1) | |
276 | Part.Parent = Vehicle | |
277 | Weld = Instance.new("Weld") | |
278 | Weld.Parent = Part | |
279 | Weld.Part0 = Base | |
280 | Weld.Part1 = Part | |
281 | Weld.C0 = CFrame.new(0, 1.3, 5.25) | |
282 | ||
283 | Part = Instance.new("Part") | |
284 | Part.Name = "Front Right Bumper" | |
285 | Part.BrickColor = MasterColor | |
286 | Part.TopSurface = "Smooth" | |
287 | Part.BottomSurface = "Smooth" | |
288 | Part.formFactor = "Symmetric" | |
289 | Part.Size = Vector3.new(2, 1, 3) | |
290 | Part.Parent = Vehicle | |
291 | Mesh = Instance.new("SpecialMesh") | |
292 | Mesh.MeshType = "Brick" | |
293 | Mesh.Scale = Vector3.new(1, 1, 0.95) | |
294 | Mesh.Parent = Part | |
295 | Weld = Instance.new("Weld") | |
296 | Weld.Parent = Part | |
297 | Weld.Part0 = Base | |
298 | Weld.Part1 = Part | |
299 | Weld.C0 = CFrame.new(5, 0, -7.075) | |
300 | ||
301 | Part = Instance.new("Part") | |
302 | Part.Name = "Front Left Bumper" | |
303 | Part.BrickColor = MasterColor | |
304 | Part.TopSurface = "Smooth" | |
305 | Part.BottomSurface = "Smooth" | |
306 | Part.formFactor = "Symmetric" | |
307 | Part.Size = Vector3.new(2, 1, 3) | |
308 | Part.Parent = Vehicle | |
309 | Mesh = Instance.new("SpecialMesh") | |
310 | Mesh.MeshType = "Brick" | |
311 | Mesh.Scale = Vector3.new(1, 1, 0.95) | |
312 | Mesh.Parent = Part | |
313 | Weld = Instance.new("Weld") | |
314 | Weld.Parent = Part | |
315 | Weld.Part0 = Base | |
316 | Weld.Part1 = Part | |
317 | Weld.C0 = CFrame.new(-5, 0, -7.075) | |
318 | ||
319 | Part = Instance.new("Part") | |
320 | Part.Name = "Right Skirt 1" | |
321 | Part.BrickColor = MasterColor | |
322 | Part.TopSurface = "Smooth" | |
323 | Part.BottomSurface = "Smooth" | |
324 | Part.formFactor = "Symmetric" | |
325 | Part.Size = Vector3.new(1, 1, 9) | |
326 | Part.Parent = Vehicle | |
327 | Mesh = Instance.new("SpecialMesh") | |
328 | Mesh.MeshType = "Brick" | |
329 | Mesh.Scale = Vector3.new(1, 1, 0.975) | |
330 | Mesh.Parent = Part | |
331 | Weld = Instance.new("Weld") | |
332 | Weld.Parent = Part | |
333 | Weld.Part0 = Base | |
334 | Weld.Part1 = Part | |
335 | Weld.C0 = CFrame.new(4.5, 0, 2) | |
336 | ||
337 | Part = Instance.new("Part") | |
338 | Part.Name = "Right Skirt 2" | |
339 | Part.BrickColor = MasterColor | |
340 | Part.TopSurface = "Smooth" | |
341 | Part.BottomSurface = "Smooth" | |
342 | Part.formFactor = "Symmetric" | |
343 | Part.Size = Vector3.new(1, 1, 9) | |
344 | Part.Parent = Vehicle | |
345 | Mesh = Instance.new("SpecialMesh") | |
346 | Mesh.MeshType = "Brick" | |
347 | Mesh.Scale = Vector3.new(1, 0.5, 0.975) | |
348 | Mesh.Parent = Part | |
349 | Weld = Instance.new("Weld") | |
350 | Weld.Parent = Part | |
351 | Weld.Part0 = Base | |
352 | Weld.Part1 = Part | |
353 | Weld.C0 = CFrame.new(5.5, -0.25, 2) | |
354 | ||
355 | Part = Instance.new("Part") | |
356 | Part.Name = "Left Skirt 1" | |
357 | Part.BrickColor = MasterColor | |
358 | Part.TopSurface = "Smooth" | |
359 | Part.BottomSurface = "Smooth" | |
360 | Part.formFactor = "Symmetric" | |
361 | Part.Size = Vector3.new(1, 1, 9) | |
362 | Part.Parent = Vehicle | |
363 | Mesh = Instance.new("SpecialMesh") | |
364 | Mesh.MeshType = "Brick" | |
365 | Mesh.Scale = Vector3.new(1, 1, 0.975) | |
366 | Mesh.Parent = Part | |
367 | Weld = Instance.new("Weld") | |
368 | Weld.Parent = Part | |
369 | Weld.Part0 = Base | |
370 | Weld.Part1 = Part | |
371 | Weld.C0 = CFrame.new(-4.5, 0, 2) | |
372 | ||
373 | Part = Instance.new("Part") | |
374 | Part.Name = "Left Skirt 2" | |
375 | Part.BrickColor = MasterColor | |
376 | Part.TopSurface = "Smooth" | |
377 | Part.BottomSurface = "Smooth" | |
378 | Part.formFactor = "Symmetric" | |
379 | Part.Size = Vector3.new(1, 1, 9) | |
380 | Part.Parent = Vehicle | |
381 | Mesh = Instance.new("SpecialMesh") | |
382 | Mesh.MeshType = "Brick" | |
383 | Mesh.Scale = Vector3.new(1, 0.5, 0.975) | |
384 | Mesh.Parent = Part | |
385 | Weld = Instance.new("Weld") | |
386 | Weld.Parent = Part | |
387 | Weld.Part0 = Base | |
388 | Weld.Part1 = Part | |
389 | Weld.C0 = CFrame.new(-5.5, -0.25, 2) | |
390 | ||
391 | Part = Instance.new("Part") | |
392 | Part.Name = "VehicleEngine" | |
393 | Part.BrickColor = MasterColor | |
394 | Part.TopSurface = "Smooth" | |
395 | Part.BottomSurface = "Smooth" | |
396 | Part.formFactor = "Symmetric" | |
397 | Part.Size = Vector3.new(12, 1, 3) | |
398 | Part.Parent = Vehicle | |
399 | Weld = Instance.new("Weld") | |
400 | Weld.Parent = Part | |
401 | Weld.Part0 = Base | |
402 | Weld.Part1 = Part | |
403 | Weld.C0 = CFrame.new(0, 1, -7) | |
404 | coroutine.wrap(function(Part2) | |
405 | local Sound = Instance.new("Sound") | |
406 | Sound.Name = "Drive" | |
407 | Sound.SoundId = "http://www.roblox.com/asset/?id=2766576" | |
408 | Sound.Volume = 1 | |
409 | Sound.Pitch = 0 | |
410 | Sound.Looped = true | |
411 | Sound.Parent = Part2 | |
412 | Sound:Play() | |
413 | while true do | |
414 | if Vehicle.Parent == nil then break end | |
415 | if Health <= 0 then break end | |
416 | Sound.Pitch = 0.05 + (math.abs(ThrottlePercent) * 0.2) | |
417 | wait() | |
418 | end | |
419 | for i = Sound.Pitch, 0, -0.01 do | |
420 | Sound.Pitch = i | |
421 | wait() | |
422 | end | |
423 | Sound:Stop() | |
424 | end)(Part) | |
425 | ||
426 | Part = Instance.new("Part") | |
427 | Part.Name = "Grill" | |
428 | Part.BrickColor = BrickColor.new("Medium stone grey") | |
429 | Part.Reflectance = 0.2 | |
430 | Part.TopSurface = "Smooth" | |
431 | Part.BottomSurface = "Smooth" | |
432 | Part.formFactor = "Symmetric" | |
433 | Part.Size = Vector3.new(4, 1, 2) | |
434 | Part.Parent = Vehicle | |
435 | Weld = Instance.new("Weld") | |
436 | Weld.Parent = Part | |
437 | Weld.Part0 = Base | |
438 | Weld.Part1 = Part | |
439 | Weld.C0 = CFrame.new(0, 2, -7.5) | |
440 | ||
441 | Part = Instance.new("Part") | |
442 | Part.Name = "Right Headlight" | |
443 | Part.BrickColor = BrickColor.new("Lime green") | |
444 | Part.Transparency = 0.5 | |
445 | Part.TopSurface = "Smooth" | |
446 | Part.BottomSurface = "Smooth" | |
447 | Part.formFactor = "Symmetric" | |
448 | Part.Size = Vector3.new(3, 1, 2) | |
449 | Part.Parent = Vehicle | |
450 | Weld = Instance.new("Weld") | |
451 | Weld.Parent = Part | |
452 | Weld.Part0 = Base | |
453 | Weld.Part1 = Part | |
454 | Weld.C0 = CFrame.new(3.5, 2, -7.5) | |
455 | ||
456 | Part = Instance.new("Part") | |
457 | Part.Name = "Right Front Turn Signal" | |
458 | Part.BrickColor = BrickColor.new("Institutional white") | |
459 | Part.Transparency = 0.5 | |
460 | Part.TopSurface = "Smooth" | |
461 | Part.BottomSurface = "Smooth" | |
462 | Part.formFactor = "Symmetric" | |
463 | Part.Size = Vector3.new(1, 1, 2) | |
464 | Part.Parent = Vehicle | |
465 | Weld = Instance.new("Weld") | |
466 | Weld.Parent = Part | |
467 | Weld.Part0 = Base | |
468 | Weld.Part1 = Part | |
469 | Weld.C0 = CFrame.new(5.5, 2, -7.5) | |
470 | ||
471 | Part = Instance.new("Part") | |
472 | Part.Name = "Left Headlight" | |
473 | Part.BrickColor = BrickColor.new("Lime green") | |
474 | Part.Transparency = 0.5 | |
475 | Part.TopSurface = "Smooth" | |
476 | Part.BottomSurface = "Smooth" | |
477 | Part.formFactor = "Symmetric" | |
478 | Part.Size = Vector3.new(3, 1, 2) | |
479 | Part.Parent = Vehicle | |
480 | Weld = Instance.new("Weld") | |
481 | Weld.Parent = Part | |
482 | Weld.Part0 = Base | |
483 | Weld.Part1 = Part | |
484 | Weld.C0 = CFrame.new(-3.5, 2, -7.5) | |
485 | ||
486 | Part = Instance.new("Part") | |
487 | Part.Name = "Left Front Turn Signal" | |
488 | Part.BrickColor = BrickColor.new("Institutional white") | |
489 | Part.Transparency = 0.5 | |
490 | Part.TopSurface = "Smooth" | |
491 | Part.BottomSurface = "Smooth" | |
492 | Part.formFactor = "Symmetric" | |
493 | Part.Size = Vector3.new(1, 1, 2) | |
494 | Part.Parent = Vehicle | |
495 | Weld = Instance.new("Weld") | |
496 | Weld.Parent = Part | |
497 | Weld.Part0 = Base | |
498 | Weld.Part1 = Part | |
499 | Weld.C0 = CFrame.new(-5.5, 2, -7.5) | |
500 | ||
501 | Part = Instance.new("Part") | |
502 | Part.Name = "Headlight Back" | |
503 | Part.BrickColor = MasterColor | |
504 | Part.TopSurface = "Smooth" | |
505 | Part.BottomSurface = "Smooth" | |
506 | Part.formFactor = "Symmetric" | |
507 | Part.Size = Vector3.new(12, 1, 4) | |
508 | Part.Parent = Vehicle | |
509 | Weld = Instance.new("Weld") | |
510 | Weld.Parent = Part | |
511 | Weld.Part0 = Base | |
512 | Weld.Part1 = Part | |
513 | Weld.C0 = CFrame.new(0, 2, -4.5) | |
514 | ||
515 | Part = Instance.new("WedgePart") | |
516 | Part.Name = "Hood" | |
517 | Part.BrickColor = MasterColor | |
518 | Part.TopSurface = "Smooth" | |
519 | Part.BottomSurface = "Smooth" | |
520 | Part.formFactor = "Symmetric" | |
521 | Part.Size = Vector3.new(12, 1, 6) | |
522 | Part.Parent = Vehicle | |
523 | Weld = Instance.new("Weld") | |
524 | Weld.Parent = Part | |
525 | Weld.Part0 = Base | |
526 | Weld.Part1 = Part | |
527 | Weld.C0 = CFrame.new(0, 3, -5.5) | |
528 | ||
529 | Part = Instance.new("WedgePart") | |
530 | Part.Name = "Front Well 1" | |
531 | Part.BrickColor = MasterColor | |
532 | Part.TopSurface = "Smooth" | |
533 | Part.BottomSurface = "Smooth" | |
534 | Part.formFactor = "Symmetric" | |
535 | Part.Size = Vector3.new(12, 1, 1) | |
536 | Part.Parent = Vehicle | |
537 | Mesh = Instance.new("SpecialMesh") | |
538 | Mesh.MeshType = "Wedge" | |
539 | Mesh.Scale = Vector3.new(1, 0.5, 0.5) | |
540 | Mesh.Parent = Part | |
541 | Weld = Instance.new("Weld") | |
542 | Weld.Parent = Part | |
543 | Weld.Part0 = Base | |
544 | Weld.Part1 = Part | |
545 | Weld.C0 = CFrame.new(0, 1.25, -5.25) * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0) | |
546 | ||
547 | Part = Instance.new("WedgePart") | |
548 | Part.Name = "Front Well 2" | |
549 | Part.BrickColor = MasterColor | |
550 | Part.TopSurface = "Smooth" | |
551 | Part.BottomSurface = "Smooth" | |
552 | Part.formFactor = "Symmetric" | |
553 | Part.Size = Vector3.new(12, 1, 1) | |
554 | Part.Parent = Vehicle | |
555 | Mesh = Instance.new("SpecialMesh") | |
556 | Mesh.MeshType = "Wedge" | |
557 | Mesh.Scale = Vector3.new(1, 0.5, 0.5) | |
558 | Mesh.Parent = Part | |
559 | Weld = Instance.new("Weld") | |
560 | Weld.Parent = Part | |
561 | Weld.Part0 = Base | |
562 | Weld.Part1 = Part | |
563 | Weld.C0 = CFrame.new(0, 1.25, -2.75) * CFrame.fromEulerAnglesXYZ(math.rad(180), math.rad(180), 0) | |
564 | ||
565 | Part = Instance.new("Part") | |
566 | Part.Name = "Front Well 3" | |
567 | Part.BrickColor = BrickColor.new("Lime green") | |
568 | Part.TopSurface = "Smooth" | |
569 | Part.BottomSurface = "Smooth" | |
570 | Part.formFactor = "Symmetric" | |
571 | Part.Size = Vector3.new(8, 1, 3) | |
572 | Part.Parent = Vehicle | |
573 | Weld = Instance.new("Weld") | |
574 | Weld.Parent = Part | |
575 | Weld.Part0 = Base | |
576 | Weld.Part1 = Part | |
577 | Weld.C0 = CFrame.new(0, 1, -4) | |
578 | ||
579 | Part = Instance.new("Part") | |
580 | Part.Name = "Front Left Roof Support" | |
581 | Part.BrickColor = MasterColor | |
582 | Part.TopSurface = "Smooth" | |
583 | Part.BottomSurface = "Smooth" | |
584 | Part.formFactor = "Symmetric" | |
585 | Part.Size = Vector3.new(1, 4, 1) | |
586 | Part.CanCollide = false | |
587 | Part.Parent = Vehicle | |
588 | Weld = Instance.new("Weld") | |
589 | Weld.Parent = Part | |
590 | Weld.Part0 = Base | |
591 | Weld.Part1 = Part | |
592 | Weld.C0 = CFrame.new(-5.5, 4.4, -1.4) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) | |
593 | ||
594 | Part = Instance.new("Part") | |
595 | Part.Name = "Front Right Roof Support" | |
596 | Part.BrickColor = MasterColor | |
597 | Part.TopSurface = "Smooth" | |
598 | Part.BottomSurface = "Smooth" | |
599 | Part.formFactor = "Symmetric" | |
600 | Part.Size = Vector3.new(1, 4, 1) | |
601 | Part.CanCollide = false | |
602 | Part.Parent = Vehicle | |
603 | Weld = Instance.new("Weld") | |
604 | Weld.Parent = Part | |
605 | Weld.Part0 = Base | |
606 | Weld.Part1 = Part | |
607 | Weld.C0 = CFrame.new(5.5, 4.4, -1.4) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) | |
608 | ||
609 | Part = Instance.new("Part") | |
610 | Part.Name = "Front Window" | |
611 | Part.BrickColor = BrickColor.new("Lime green") | |
612 | Part.Transparency = 0.75 | |
613 | Part.TopSurface = "Smooth" | |
614 | Part.BottomSurface = "Smooth" | |
615 | Part.formFactor = "Symmetric" | |
616 | Part.Size = Vector3.new(10, 4, 1) | |
617 | Part.Parent = Vehicle | |
618 | Mesh = Instance.new("SpecialMesh") | |
619 | Mesh.MeshType = "Brick" | |
620 | Mesh.Scale = Vector3.new(1, 1, 0.1) | |
621 | Mesh.Parent = Part | |
622 | Weld = Instance.new("Weld") | |
623 | Weld.Parent = Part | |
624 | Weld.Part0 = Base | |
625 | Weld.Part1 = Part | |
626 | Weld.C0 = CFrame.new(0, 4.75, -1.75) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) | |
627 | ||
628 | Part = Instance.new("Part") | |
629 | Part.Name = "Roof 1" | |
630 | Part.CanCollide = false | |
631 | Part.BrickColor = MasterColor | |
632 | Part.TopSurface = "Smooth" | |
633 | Part.BottomSurface = "Smooth" | |
634 | Part.formFactor = "Symmetric" | |
635 | Part.Size = Vector3.new(12, 1, 6) | |
636 | Part.Parent = Vehicle | |
637 | Weld = Instance.new("Weld") | |
638 | Weld.Parent = Part | |
639 | Weld.Part0 = Base | |
640 | Weld.Part1 = Part | |
641 | Weld.C0 = CFrame.new(0, 5.675, 2.654) | |
642 | ||
643 | Part = Instance.new("Part") | |
644 | Part.Name = "Roof 2" | |
645 | Part.Transparency = 1 | |
646 | Part.TopSurface = "Smooth" | |
647 | Part.BottomSurface = "Smooth" | |
648 | Part.formFactor = "Symmetric" | |
649 | Part.Size = Vector3.new(12, 1, 6) | |
650 | Part.Parent = Vehicle | |
651 | Weld = Instance.new("Weld") | |
652 | Weld.Parent = Part | |
653 | Weld.Part0 = Base | |
654 | Weld.Part1 = Part | |
655 | Weld.C0 = CFrame.new(0, 6.675, 2.654) | |
656 | ||
657 | Part = Instance.new("Part") | |
658 | Part.Name = "Dashboard Back" | |
659 | Part.BrickColor = MasterColor | |
660 | Part.TopSurface = "Smooth" | |
661 | Part.BottomSurface = "Smooth" | |
662 | Part.formFactor = "Symmetric" | |
663 | Part.Size = Vector3.new(12, 4, 1) | |
664 | Part.Parent = Vehicle | |
665 | Mesh = Instance.new("SpecialMesh") | |
666 | Mesh.MeshType = "Brick" | |
667 | Mesh.Scale = Vector3.new(1, 1, 0.5) | |
668 | Mesh.Parent = Part | |
669 | Weld = Instance.new("Weld") | |
670 | Weld.Parent = Part | |
671 | Weld.Part0 = Base | |
672 | Weld.Part1 = Part | |
673 | Weld.C0 = CFrame.new(0, 1.5, -2.25) | |
674 | ||
675 | Part = Instance.new("Part") | |
676 | Part.Name = "Steeringwheel" | |
677 | Part.BrickColor = BrickColor.new("Black") | |
678 | Part.TopSurface = "Smooth" | |
679 | Part.BottomSurface = "Smooth" | |
680 | Part.formFactor = "Symmetric" | |
681 | Part.Size = Vector3.new(2, 2, 1) | |
682 | Part.CanCollide = false | |
683 | Part.Parent = Vehicle | |
684 | Mesh = Instance.new("SpecialMesh") | |
685 | Mesh.MeshType = "Sphere" | |
686 | Mesh.Scale = Vector3.new(1.25, 1.25, 0.5) | |
687 | Mesh.Parent = Part | |
688 | Weld = Instance.new("Weld") | |
689 | Weld.Parent = Part | |
690 | Weld.Part0 = Base | |
691 | Weld.Part1 = Part | |
692 | Weld.C0 = CFrame.new(-2.5, 3, -1.5) | |
693 | ||
694 | Part = Instance.new("Part") | |
695 | Part.Name = "Steering Column" | |
696 | Part.BrickColor = BrickColor.new("Black") | |
697 | Part.TopSurface = "Smooth" | |
698 | Part.BottomSurface = "Smooth" | |
699 | Part.formFactor = "Symmetric" | |
700 | Part.Size = Vector3.new(1, 1, 1) | |
701 | Part.CanCollide = false | |
702 | Part.Parent = Vehicle | |
703 | Weld = Instance.new("Weld") | |
704 | Weld.Parent = Part | |
705 | Weld.Part0 = Base | |
706 | Weld.Part1 = Part | |
707 | Weld.C0 = CFrame.new(-2.5, 2.95, -1.9) | |
708 | ||
709 | Part = Instance.new("Part") | |
710 | Part.Name = "Left Front Turn Signal Button" | |
711 | Part.BrickColor = BrickColor.new("Bright green") | |
712 | Part.TopSurface = "Smooth" | |
713 | Part.BottomSurface = "Smooth" | |
714 | Part.formFactor = "Symmetric" | |
715 | Part.Size = Vector3.new(1, 1, 1) | |
716 | Part.CanCollide = false | |
717 | Part.Parent = Vehicle | |
718 | Mesh = Instance.new("CylinderMesh") | |
719 | Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) | |
720 | Mesh.Parent = Part | |
721 | Weld = Instance.new("Weld") | |
722 | Weld.Parent = Part | |
723 | Weld.Part0 = Base | |
724 | Weld.Part1 = Part | |
725 | Weld.C0 = CFrame.new(-0.5, 2.5, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
726 | local Open = Instance.new("ClickDetector") | |
727 | Open.Parent = Part | |
728 | coroutine.wrap(function(Part2, Weld2) | |
729 | local SignalOn = false | |
730 | Open.MouseClick:connect(function() | |
731 | SignalOn = not SignalOn | |
732 | Part2.BrickColor = SignalOn == true and BrickColor.new("Institutional white") or BrickColor.new("Bright green") | |
733 | coroutine.wrap(function() | |
734 | if SignalOn == true then | |
735 | for i = 0, 0.1, 0.01 do | |
736 | Weld2.C1 = CFrame.new(0, i, 0) | |
737 | wait() | |
738 | end | |
739 | Weld2.C1 = CFrame.new(0, 0.1, 0) | |
740 | else | |
741 | for i = 0.1, 0, -0.01 do | |
742 | Weld2.C1 = CFrame.new(0, i, 0) | |
743 | wait() | |
744 | end | |
745 | Weld2.C1 = CFrame.new(0, 0, 0) | |
746 | end | |
747 | end)() | |
748 | end) | |
749 | local i = false | |
750 | coroutine.wrap(function() | |
751 | while true do | |
752 | i = not i | |
753 | wait(0.5) | |
754 | end | |
755 | end)() | |
756 | while true do | |
757 | if Vehicle:FindFirstChild("Left Front Turn Signal") ~= nil then | |
758 | if Vehicle["Left Front Turn Signal"]:FindFirstChild("Weld") == nil or SignalOn == false or i == false then | |
759 | Vehicle["Left Front Turn Signal"].Transparency = 0.5 | |
760 | else | |
761 | Vehicle["Left Front Turn Signal"].Transparency = 0 | |
762 | end | |
763 | end | |
764 | if Vehicle:FindFirstChild("Left Rear Turn Signal") ~= nil then | |
765 | if Vehicle["Left Rear Turn Signal"]:FindFirstChild("Weld") == nil or SignalOn == false or i == false then | |
766 | Vehicle["Left Rear Turn Signal"].Transparency = 0.5 | |
767 | else | |
768 | Vehicle["Left Rear Turn Signal"].Transparency = 0 | |
769 | end | |
770 | end | |
771 | wait() | |
772 | end | |
773 | end)(Part, Weld) | |
774 | ||
775 | Part = Instance.new("Part") | |
776 | Part.Name = "Headlights Button" | |
777 | Part.BrickColor = BrickColor.new("Institutional white") | |
778 | Part.TopSurface = "Smooth" | |
779 | Part.BottomSurface = "Smooth" | |
780 | Part.formFactor = "Symmetric" | |
781 | Part.Size = Vector3.new(1, 1, 1) | |
782 | Part.CanCollide = false | |
783 | Part.Parent = Vehicle | |
784 | Mesh = Instance.new("CylinderMesh") | |
785 | Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) | |
786 | Mesh.Parent = Part | |
787 | Weld = Instance.new("Weld") | |
788 | Weld.Parent = Part | |
789 | Weld.Part0 = Base | |
790 | Weld.Part1 = Part | |
791 | Weld.C0 = CFrame.new(0, 2.5, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
792 | local Open = Instance.new("ClickDetector") | |
793 | Open.Parent = Part | |
794 | coroutine.wrap(function(Part2, Weld2) | |
795 | local HeadlightsOn = false | |
796 | Open.MouseClick:connect(function() | |
797 | HeadlightsOn = not HeadlightsOn | |
798 | Part2.BrickColor = HeadlightsOn == true and BrickColor.new("Black") or BrickColor.new("Institutional white") | |
799 | coroutine.wrap(function() | |
800 | if HeadlightsOn == true then | |
801 | for i = 0, 0.1, 0.01 do | |
802 | Weld2.C1 = CFrame.new(0, i, 0) | |
803 | wait() | |
804 | end | |
805 | Weld2.C1 = CFrame.new(0, 0.1, 0) | |
806 | else | |
807 | for i = 0.1, 0, -0.01 do | |
808 | Weld2.C1 = CFrame.new(0, i, 0) | |
809 | wait() | |
810 | end | |
811 | Weld2.C1 = CFrame.new(0, 0, 0) | |
812 | end | |
813 | end)() | |
814 | end) | |
815 | while true do | |
816 | if Vehicle:FindFirstChild("Left Headlight") ~= nil then | |
817 | if Vehicle["Left Headlight"]:FindFirstChild("Weld") == nil or HeadlightsOn == false then | |
818 | Vehicle["Left Headlight"].Transparency = 0.5 | |
819 | else | |
820 | Vehicle["Left Headlight"].Transparency = 0 | |
821 | end | |
822 | end | |
823 | if Vehicle:FindFirstChild("Right Headlight") ~= nil then | |
824 | if Vehicle["Right Headlight"]:FindFirstChild("Weld") == nil or HeadlightsOn == false then | |
825 | Vehicle["Right Headlight"].Transparency = 0.5 | |
826 | else | |
827 | Vehicle["Right Headlight"].Transparency = 0 | |
828 | end | |
829 | end | |
830 | wait() | |
831 | end | |
832 | end)(Part, Weld) | |
833 | ||
834 | Part = Instance.new("Part") | |
835 | Part.Name = "Right Front Turn Signal Button" | |
836 | Part.BrickColor = BrickColor.new("Bright green") | |
837 | Part.TopSurface = "Smooth" | |
838 | Part.BottomSurface = "Smooth" | |
839 | Part.formFactor = "Symmetric" | |
840 | Part.Size = Vector3.new(1, 1, 1) | |
841 | Part.CanCollide = false | |
842 | Part.Parent = Vehicle | |
843 | Mesh = Instance.new("CylinderMesh") | |
844 | Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) | |
845 | Mesh.Parent = Part | |
846 | Weld = Instance.new("Weld") | |
847 | Weld.Parent = Part | |
848 | Weld.Part0 = Base | |
849 | Weld.Part1 = Part | |
850 | Weld.C0 = CFrame.new(0.5, 2.5, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
851 | local Open = Instance.new("ClickDetector") | |
852 | Open.Parent = Part | |
853 | coroutine.wrap(function(Part2, Weld2) | |
854 | local SignalOn = false | |
855 | Open.MouseClick:connect(function() | |
856 | SignalOn = not SignalOn | |
857 | Part2.BrickColor = SignalOn == true and BrickColor.new("Indistrial white") or BrickColor.new("Bright green") | |
858 | coroutine.wrap(function() | |
859 | if SignalOn == true then | |
860 | for i = 0, 0.1, 0.01 do | |
861 | Weld2.C1 = CFrame.new(0, i, 0) | |
862 | wait() | |
863 | end | |
864 | Weld2.C1 = CFrame.new(0, 0.1, 0) | |
865 | else | |
866 | for i = 0.1, 0, -0.01 do | |
867 | Weld2.C1 = CFrame.new(0, i, 0) | |
868 | wait() | |
869 | end | |
870 | Weld2.C1 = CFrame.new(0, 0, 0) | |
871 | end | |
872 | end)() | |
873 | end) | |
874 | local i = false | |
875 | coroutine.wrap(function() | |
876 | while true do | |
877 | i = not i | |
878 | wait(0.5) | |
879 | end | |
880 | end)() | |
881 | while true do | |
882 | if Vehicle:FindFirstChild("Right Front Turn Signal") ~= nil then | |
883 | if Vehicle["Right Front Turn Signal"]:FindFirstChild("Weld") == nil or SignalOn == false or i == false then | |
884 | Vehicle["Right Front Turn Signal"].Transparency = 0.5 | |
885 | else | |
886 | Vehicle["Right Front Turn Signal"].Transparency = 0 | |
887 | end | |
888 | if Vehicle:FindFirstChild("Right Rear Turn Signal") ~= nil then | |
889 | if Vehicle["Right Rear Turn Signal"]:FindFirstChild("Weld") == nil or SignalOn == false or i == false then | |
890 | Vehicle["Right Rear Turn Signal"].Transparency = 0.5 | |
891 | else | |
892 | Vehicle["Right Rear Turn Signal"].Transparency = 0 | |
893 | end | |
894 | end | |
895 | end | |
896 | wait() | |
897 | end | |
898 | end)(Part, Weld) | |
899 | ||
900 | Part = Instance.new("Part") | |
901 | Part.Name = "Front Left Door" | |
902 | Part.BrickColor = MasterColor | |
903 | Part.TopSurface = "Smooth" | |
904 | Part.BottomSurface = "Smooth" | |
905 | Part.formFactor = "Symmetric" | |
906 | Part.Size = Vector3.new(1, 3, 4) | |
907 | Part.Parent = Vehicle | |
908 | Weld = Instance.new("Weld") | |
909 | Weld.Parent = Part | |
910 | Weld.Part0 = Base | |
911 | Weld.Part1 = Part | |
912 | Weld.C0 = CFrame.new(-6, 1.5, -2) | |
913 | Weld.C1 = CFrame.new(-0.5, 0, -2) | |
914 | local Open = Instance.new("ClickDetector") | |
915 | Open.Parent = Part | |
916 | coroutine.wrap(function(Weld2) | |
917 | local IsOpen = false | |
918 | local CanOpen = true | |
919 | Open.MouseClick:connect(function() | |
920 | if IsOpen == false and CanOpen == true then | |
921 | CanOpen = false | |
922 | IsOpen = true | |
923 | for i = 0, 1, 0.1 do | |
924 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0) | |
925 | wait() | |
926 | end | |
927 | CanOpen = true | |
928 | elseif IsOpen == true and CanOpen == true then | |
929 | CanOpen = false | |
930 | IsOpen = false | |
931 | for i = 1, 0, -0.1 do | |
932 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0) | |
933 | wait() | |
934 | end | |
935 | CanOpen = true | |
936 | end | |
937 | end) | |
938 | end)(Weld) | |
939 | ||
940 | Part = Instance.new("Part") | |
941 | Part.Name = "Front Right Door" | |
942 | Part.BrickColor = MasterColor | |
943 | Part.TopSurface = "Smooth" | |
944 | Part.BottomSurface = "Smooth" | |
945 | Part.formFactor = "Symmetric" | |
946 | Part.Size = Vector3.new(1, 3, 4) | |
947 | Part.Parent = Vehicle | |
948 | Weld = Instance.new("Weld") | |
949 | Weld.Parent = Part | |
950 | Weld.Part0 = Base | |
951 | Weld.Part1 = Part | |
952 | Weld.C0 = CFrame.new(6, 1.5, -2) | |
953 | Weld.C1 = CFrame.new(0.5, 0, -2) | |
954 | local Open = Instance.new("ClickDetector") | |
955 | Open.Parent = Part | |
956 | coroutine.wrap(function(Weld2) | |
957 | local IsOpen = false | |
958 | local CanOpen = true | |
959 | Open.MouseClick:connect(function() | |
960 | if IsOpen == false and CanOpen == true then | |
961 | CanOpen = false | |
962 | IsOpen = true | |
963 | for i = 0, 1, 0.1 do | |
964 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0) | |
965 | wait() | |
966 | end | |
967 | CanOpen = true | |
968 | elseif IsOpen == true and CanOpen == true then | |
969 | CanOpen = false | |
970 | IsOpen = false | |
971 | for i = 1, 0, -0.1 do | |
972 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0) | |
973 | wait() | |
974 | end | |
975 | CanOpen = true | |
976 | end | |
977 | end) | |
978 | end)(Weld) | |
979 | ||
980 | Part = Instance.new("Part") | |
981 | Part.Name = "Rear Left Door" | |
982 | Part.BrickColor = MasterColor | |
983 | Part.TopSurface = "Smooth" | |
984 | Part.BottomSurface = "Smooth" | |
985 | Part.formFactor = "Symmetric" | |
986 | Part.Size = Vector3.new(1, 3, 4) | |
987 | Part.Parent = Vehicle | |
988 | Weld = Instance.new("Weld") | |
989 | Weld.Parent = Part | |
990 | Weld.Part0 = Base | |
991 | Weld.Part1 = Part | |
992 | Weld.C0 = CFrame.new(-6, 1.5, 2) | |
993 | Weld.C1 = CFrame.new(-0.5, 0, -2) | |
994 | local Open = Instance.new("ClickDetector") | |
995 | Open.Parent = Part | |
996 | coroutine.wrap(function(Weld2) | |
997 | local IsOpen = false | |
998 | local CanOpen = true | |
999 | Open.MouseClick:connect(function() | |
1000 | if IsOpen == false and CanOpen == true then | |
1001 | CanOpen = false | |
1002 | IsOpen = true | |
1003 | for i = 0, 1, 0.1 do | |
1004 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0) | |
1005 | wait() | |
1006 | end | |
1007 | CanOpen = true | |
1008 | elseif IsOpen == true and CanOpen == true then | |
1009 | CanOpen = false | |
1010 | IsOpen = false | |
1011 | for i = 1, 0, -0.1 do | |
1012 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0) | |
1013 | wait() | |
1014 | end | |
1015 | CanOpen = true | |
1016 | end | |
1017 | end) | |
1018 | end)(Weld) | |
1019 | ||
1020 | Part = Instance.new("Part") | |
1021 | Part.Name = "Rear Right Door" | |
1022 | Part.BrickColor = MasterColor | |
1023 | Part.TopSurface = "Smooth" | |
1024 | Part.BottomSurface = "Smooth" | |
1025 | Part.formFactor = "Symmetric" | |
1026 | Part.Size = Vector3.new(1, 3, 4) | |
1027 | Part.Parent = Vehicle | |
1028 | Weld = Instance.new("Weld") | |
1029 | Weld.Parent = Part | |
1030 | Weld.Part0 = Base | |
1031 | Weld.Part1 = Part | |
1032 | Weld.C0 = CFrame.new(6, 1.5, 2) | |
1033 | Weld.C1 = CFrame.new(0.5, 0, -2) | |
1034 | local Open = Instance.new("ClickDetector") | |
1035 | Open.Parent = Part | |
1036 | coroutine.wrap(function(Weld2) | |
1037 | local IsOpen = false | |
1038 | local CanOpen = true | |
1039 | Open.MouseClick:connect(function() | |
1040 | if IsOpen == false and CanOpen == true then | |
1041 | CanOpen = false | |
1042 | IsOpen = true | |
1043 | for i = 0, 1, 0.1 do | |
1044 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0) | |
1045 | wait() | |
1046 | end | |
1047 | CanOpen = true | |
1048 | elseif IsOpen == true and CanOpen == true then | |
1049 | CanOpen = false | |
1050 | IsOpen = false | |
1051 | for i = 1, 0, -0.1 do | |
1052 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0) | |
1053 | wait() | |
1054 | end | |
1055 | CanOpen = true | |
1056 | end | |
1057 | end) | |
1058 | end)(Weld) | |
1059 | ||
1060 | Part = Instance.new("Part") | |
1061 | Part.Name = "Rear Right Bumper" | |
1062 | Part.BrickColor = MasterColor | |
1063 | Part.TopSurface = "Smooth" | |
1064 | Part.BottomSurface = "Smooth" | |
1065 | Part.formFactor = "Symmetric" | |
1066 | Part.Size = Vector3.new(2, 1, 2) | |
1067 | Part.Parent = Vehicle | |
1068 | Mesh = Instance.new("SpecialMesh") | |
1069 | Mesh.MeshType = "Brick" | |
1070 | Mesh.Scale = Vector3.new(1, 1, 0.95) | |
1071 | Mesh.Parent = Part | |
1072 | Weld = Instance.new("Weld") | |
1073 | Weld.Parent = Part | |
1074 | Weld.Part0 = Base | |
1075 | Weld.Part1 = Part | |
1076 | Weld.C0 = CFrame.new(5, 0, 10.55) | |
1077 | ||
1078 | Part = Instance.new("Part") | |
1079 | Part.Name = "Rear Left Bumper" | |
1080 | Part.BrickColor = MasterColor | |
1081 | Part.TopSurface = "Smooth" | |
1082 | Part.BottomSurface = "Smooth" | |
1083 | Part.formFactor = "Symmetric" | |
1084 | Part.Size = Vector3.new(2, 1, 2) | |
1085 | Part.Parent = Vehicle | |
1086 | Mesh = Instance.new("SpecialMesh") | |
1087 | Mesh.MeshType = "Brick" | |
1088 | Mesh.Scale = Vector3.new(1, 1, 0.95) | |
1089 | Mesh.Parent = Part | |
1090 | Weld = Instance.new("Weld") | |
1091 | Weld.Parent = Part | |
1092 | Weld.Part0 = Base | |
1093 | Weld.Part1 = Part | |
1094 | Weld.C0 = CFrame.new(-5, 0, 10.55) | |
1095 | ||
1096 | Part = Instance.new("Part") | |
1097 | Part.Name = "Rear Center Bumper" | |
1098 | Part.BrickColor = MasterColor | |
1099 | Part.TopSurface = "Smooth" | |
1100 | Part.BottomSurface = "Smooth" | |
1101 | Part.formFactor = "Symmetric" | |
1102 | Part.Size = Vector3.new(8, 1, 3) | |
1103 | Part.Parent = Vehicle | |
1104 | Mesh = Instance.new("SpecialMesh") | |
1105 | Mesh.MeshType = "Brick" | |
1106 | Mesh.Scale = Vector3.new(1, 0.5, 1) | |
1107 | Mesh.Parent = Part | |
1108 | Weld = Instance.new("Weld") | |
1109 | Weld.Parent = Part | |
1110 | Weld.Part0 = Base | |
1111 | Weld.Part1 = Part | |
1112 | Weld.C0 = CFrame.new(0, -0.25, 10) | |
1113 | ||
1114 | Part = Instance.new("Part") | |
1115 | Part.Name = "Rear Left Roof Support" | |
1116 | Part.BrickColor = MasterColor | |
1117 | Part.TopSurface = "Smooth" | |
1118 | Part.BottomSurface = "Smooth" | |
1119 | Part.formFactor = "Symmetric" | |
1120 | Part.Size = Vector3.new(1, 4, 1) | |
1121 | Part.Parent = Vehicle | |
1122 | Weld = Instance.new("Weld") | |
1123 | Weld.Parent = Part | |
1124 | Weld.Part0 = Base | |
1125 | Weld.Part1 = Part | |
1126 | Weld.C0 = CFrame.new(-5.5, 4.125, 5.875) * CFrame.fromEulerAnglesXYZ(math.rad(-20), 0, 0) | |
1127 | ||
1128 | Part = Instance.new("Part") | |
1129 | Part.Name = "Rear Right Roof Support" | |
1130 | Part.BrickColor = MasterColor | |
1131 | Part.TopSurface = "Smooth" | |
1132 | Part.BottomSurface = "Smooth" | |
1133 | Part.formFactor = "Symmetric" | |
1134 | Part.Size = Vector3.new(1, 4, 1) | |
1135 | Part.Parent = Vehicle | |
1136 | Weld = Instance.new("Weld") | |
1137 | Weld.Parent = Part | |
1138 | Weld.Part0 = Base | |
1139 | Weld.Part1 = Part | |
1140 | Weld.C0 = CFrame.new(5.5, 4.125, 5.875) * CFrame.fromEulerAnglesXYZ(math.rad(-20), 0, 0) | |
1141 | ||
1142 | Part = Instance.new("Part") | |
1143 | Part.Name = "Rear Window" | |
1144 | Part.BrickColor = BrickColor.new("Lime green") | |
1145 | Part.Transparency = 0.75 | |
1146 | Part.TopSurface = "Smooth" | |
1147 | Part.BottomSurface = "Smooth" | |
1148 | Part.formFactor = "Symmetric" | |
1149 | Part.Size = Vector3.new(10, 4, 1) | |
1150 | Part.Parent = Vehicle | |
1151 | Weld = Instance.new("Weld") | |
1152 | Weld.Parent = Part | |
1153 | Weld.Part0 = Base | |
1154 | Weld.Part1 = Part | |
1155 | Weld.C0 = CFrame.new(0, 4.125, 5.875) * CFrame.fromEulerAnglesXYZ(math.rad(-20), 0, 0) | |
1156 | ||
1157 | Part = Instance.new("Part") | |
1158 | Part.Name = "Center 1" | |
1159 | Part.BrickColor = MasterColor | |
1160 | Part.TopSurface = "Smooth" | |
1161 | Part.BottomSurface = "Smooth" | |
1162 | Part.formFactor = "Symmetric" | |
1163 | Part.Size = Vector3.new(12, 3, 1) | |
1164 | Part.Parent = Vehicle | |
1165 | Mesh = Instance.new("SpecialMesh") | |
1166 | Mesh.MeshType = "Brick" | |
1167 | Mesh.Scale = Vector3.new(1, 1, 0.5) | |
1168 | Mesh.Parent = Part | |
1169 | Weld = Instance.new("Weld") | |
1170 | Weld.Parent = Part | |
1171 | Weld.Part0 = Base | |
1172 | Weld.Part1 = Part | |
1173 | Weld.C0 = CFrame.new(0, 1.5, 6.25) | |
1174 | ||
1175 | Part = Instance.new("Part") | |
1176 | Part.Name = "Center 2" | |
1177 | Part.BrickColor = MasterColor | |
1178 | Part.TopSurface = "Smooth" | |
1179 | Part.BottomSurface = "Smooth" | |
1180 | Part.formFactor = "Symmetric" | |
1181 | Part.Size = Vector3.new(8, 3, 1) | |
1182 | Part.Parent = Vehicle | |
1183 | Weld = Instance.new("Weld") | |
1184 | Weld.Parent = Part | |
1185 | Weld.Part0 = Base | |
1186 | Weld.Part1 = Part | |
1187 | Weld.C0 = CFrame.new(0, 1.5, 7) | |
1188 | ||
1189 | Part = Instance.new("Part") | |
1190 | Part.Name = "Rear Left Well 1" | |
1191 | Part.BrickColor = MasterColor | |
1192 | Part.TopSurface = "Smooth" | |
1193 | Part.BottomSurface = "Smooth" | |
1194 | Part.formFactor = "Symmetric" | |
1195 | Part.Size = Vector3.new(2, 2, 3) | |
1196 | Part.Parent = Vehicle | |
1197 | Mesh = Instance.new("SpecialMesh") | |
1198 | Mesh.MeshType = "Brick" | |
1199 | Mesh.Scale = Vector3.new(1, 0.75, 1) | |
1200 | Mesh.Parent = Part | |
1201 | Weld = Instance.new("Weld") | |
1202 | Weld.Parent = Part | |
1203 | Weld.Part0 = Base | |
1204 | Weld.Part1 = Part | |
1205 | Weld.C0 = CFrame.new(-5, 2.25, 8) | |
1206 | ||
1207 | Part = Instance.new("Part") | |
1208 | Part.Name = "Rear Left Well 2" | |
1209 | Part.BrickColor = MasterColor | |
1210 | Part.TopSurface = "Smooth" | |
1211 | Part.BottomSurface = "Smooth" | |
1212 | Part.formFactor = "Symmetric" | |
1213 | Part.Size = Vector3.new(2, 3, 2) | |
1214 | Part.Parent = Vehicle | |
1215 | Mesh = Instance.new("SpecialMesh") | |
1216 | Mesh.MeshType = "Brick" | |
1217 | Mesh.Scale = Vector3.new(1, 0.837, 1) | |
1218 | Mesh.Parent = Part | |
1219 | Weld = Instance.new("Weld") | |
1220 | Weld.Parent = Part | |
1221 | Weld.Part0 = Base | |
1222 | Weld.Part1 = Part | |
1223 | Weld.C0 = CFrame.new(-5, 1.75, 10.5) | |
1224 | ||
1225 | Part = Instance.new("Part") | |
1226 | Part.Name = "Rear Right Well 1" | |
1227 | Part.BrickColor = MasterColor | |
1228 | Part.TopSurface = "Smooth" | |
1229 | Part.BottomSurface = "Smooth" | |
1230 | Part.formFactor = "Symmetric" | |
1231 | Part.Size = Vector3.new(2, 2, 3) | |
1232 | Part.Parent = Vehicle | |
1233 | Mesh = Instance.new("SpecialMesh") | |
1234 | Mesh.MeshType = "Brick" | |
1235 | Mesh.Scale = Vector3.new(1, 0.75, 1) | |
1236 | Mesh.Parent = Part | |
1237 | Weld = Instance.new("Weld") | |
1238 | Weld.Parent = Part | |
1239 | Weld.Part0 = Base | |
1240 | Weld.Part1 = Part | |
1241 | Weld.C0 = CFrame.new(5, 2.25, 8) | |
1242 | ||
1243 | Part = Instance.new("Part") | |
1244 | Part.Name = "Rear Right Well 2" | |
1245 | Part.BrickColor = MasterColor | |
1246 | Part.TopSurface = "Smooth" | |
1247 | Part.BottomSurface = "Smooth" | |
1248 | Part.formFactor = "Symmetric" | |
1249 | Part.Size = Vector3.new(2, 3, 2) | |
1250 | Part.Parent = Vehicle | |
1251 | Mesh = Instance.new("SpecialMesh") | |
1252 | Mesh.MeshType = "Brick" | |
1253 | Mesh.Scale = Vector3.new(1, 0.837, 1) | |
1254 | Mesh.Parent = Part | |
1255 | Weld = Instance.new("Weld") | |
1256 | Weld.Parent = Part | |
1257 | Weld.Part0 = Base | |
1258 | Weld.Part1 = Part | |
1259 | Weld.C0 = CFrame.new(5, 1.75, 10.5) | |
1260 | ||
1261 | Part = Instance.new("WedgePart") | |
1262 | Part.Name = "Rear Well 1" | |
1263 | Part.BrickColor = MasterColor | |
1264 | Part.TopSurface = "Smooth" | |
1265 | Part.BottomSurface = "Smooth" | |
1266 | Part.formFactor = "Symmetric" | |
1267 | Part.Size = Vector3.new(12, 1, 1) | |
1268 | Part.Parent = Vehicle | |
1269 | Mesh = Instance.new("SpecialMesh") | |
1270 | Mesh.MeshType = "Wedge" | |
1271 | Mesh.Scale = Vector3.new(1, 0.5, 0.5) | |
1272 | Mesh.Parent = Part | |
1273 | Weld = Instance.new("Weld") | |
1274 | Weld.Parent = Part | |
1275 | Weld.Part0 = Base | |
1276 | Weld.Part1 = Part | |
1277 | Weld.C0 = CFrame.new(0, 1.25, 6.75) * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0) | |
1278 | ||
1279 | Part = Instance.new("WedgePart") | |
1280 | Part.Name = "Rear Left Well 3" | |
1281 | Part.BrickColor = MasterColor | |
1282 | Part.TopSurface = "Smooth" | |
1283 | Part.BottomSurface = "Smooth" | |
1284 | Part.formFactor = "Symmetric" | |
1285 | Part.Size = Vector3.new(2, 1, 1) | |
1286 | Part.Parent = Vehicle | |
1287 | Mesh = Instance.new("SpecialMesh") | |
1288 | Mesh.MeshType = "Wedge" | |
1289 | Mesh.Scale = Vector3.new(1, 0.5, 0.5) | |
1290 | Mesh.Parent = Part | |
1291 | Weld = Instance.new("Weld") | |
1292 | Weld.Parent = Part | |
1293 | Weld.Part0 = Base | |
1294 | Weld.Part1 = Part | |
1295 | Weld.C0 = CFrame.new(-5, 1.25, 9.25) * CFrame.fromEulerAnglesXYZ(math.rad(180), math.rad(180), 0) | |
1296 | ||
1297 | Part = Instance.new("WedgePart") | |
1298 | Part.Name = "Rear Right Well 3" | |
1299 | Part.BrickColor = MasterColor | |
1300 | Part.TopSurface = "Smooth" | |
1301 | Part.BottomSurface = "Smooth" | |
1302 | Part.formFactor = "Symmetric" | |
1303 | Part.Size = Vector3.new(2, 1, 1) | |
1304 | Part.Parent = Vehicle | |
1305 | Mesh = Instance.new("SpecialMesh") | |
1306 | Mesh.MeshType = "Wedge" | |
1307 | Mesh.Scale = Vector3.new(1, 0.5, 0.5) | |
1308 | Mesh.Parent = Part | |
1309 | Weld = Instance.new("Weld") | |
1310 | Weld.Parent = Part | |
1311 | Weld.Part0 = Base | |
1312 | Weld.Part1 = Part | |
1313 | Weld.C0 = CFrame.new(5, 1.25, 9.25) * CFrame.fromEulerAnglesXYZ(math.rad(180), math.rad(180), 0) | |
1314 | ||
1315 | Part = Instance.new("Part") | |
1316 | Part.Name = "Bottom Trunk Lining" | |
1317 | Part.BrickColor = BrickColor.new("Lime green") | |
1318 | Part.TopSurface = "Smooth" | |
1319 | Part.BottomSurface = "Smooth" | |
1320 | Part.formFactor = "Symmetric" | |
1321 | Part.Size = Vector3.new(8, 1, 3) | |
1322 | Part.Parent = Vehicle | |
1323 | Mesh = Instance.new("SpecialMesh") | |
1324 | Mesh.MeshType = "Brick" | |
1325 | Mesh.Scale = Vector3.new(1, 0.5025, 1.5) | |
1326 | Mesh.Parent = Part | |
1327 | Weld = Instance.new("Weld") | |
1328 | Weld.Parent = Part | |
1329 | Weld.Part0 = Base | |
1330 | Weld.Part1 = Part | |
1331 | Weld.C0 = CFrame.new(0, 0.25, 9.25) | |
1332 | ||
1333 | Part = Instance.new("Part") | |
1334 | Part.Name = "Left Trunk Lining" | |
1335 | Part.BrickColor = BrickColor.new("Lime green") | |
1336 | Part.TopSurface = "Smooth" | |
1337 | Part.BottomSurface = "Smooth" | |
1338 | Part.formFactor = "Symmetric" | |
1339 | Part.Size = Vector3.new(1, 3, 4) | |
1340 | Part.Parent = Vehicle | |
1341 | Mesh = Instance.new("SpecialMesh") | |
1342 | Mesh.MeshType = "Brick" | |
1343 | Mesh.Scale = Vector3.new(0.5, 1, 1) | |
1344 | Mesh.Parent = Part | |
1345 | Weld = Instance.new("Weld") | |
1346 | Weld.Parent = Part | |
1347 | Weld.Part0 = Base | |
1348 | Weld.Part1 = Part | |
1349 | Weld.C0 = CFrame.new(-3.75, 1.5, 9.5) | |
1350 | ||
1351 | Part = Instance.new("Part") | |
1352 | Part.Name = "Right Trunk Lining" | |
1353 | Part.BrickColor = BrickColor.new("Lime green") | |
1354 | Part.TopSurface = "Smooth" | |
1355 | Part.BottomSurface = "Smooth" | |
1356 | Part.formFactor = "Symmetric" | |
1357 | Part.Size = Vector3.new(1, 3, 4) | |
1358 | Part.Parent = Vehicle | |
1359 | Mesh = Instance.new("SpecialMesh") | |
1360 | Mesh.MeshType = "Brick" | |
1361 | Mesh.Scale = Vector3.new(0.5, 1, 1) | |
1362 | Mesh.Parent = Part | |
1363 | Weld = Instance.new("Weld") | |
1364 | Weld.Parent = Part | |
1365 | Weld.Part0 = Base | |
1366 | Weld.Part1 = Part | |
1367 | Weld.C0 = CFrame.new(3.75, 1.5, 9.5) | |
1368 | ||
1369 | Part = Instance.new("WedgePart") | |
1370 | Part.Name = "Front Trunk Lining" | |
1371 | Part.BrickColor = BrickColor.new("Lime green") | |
1372 | Part.TopSurface = "Smooth" | |
1373 | Part.BottomSurface = "Smooth" | |
1374 | Part.formFactor = "Symmetric" | |
1375 | Part.Size = Vector3.new(7, 3, 1) | |
1376 | Part.Parent = Vehicle | |
1377 | Weld = Instance.new("Weld") | |
1378 | Weld.Parent = Part | |
1379 | Weld.Part0 = Base | |
1380 | Weld.Part1 = Part | |
1381 | Weld.C0 = CFrame.new(0, 1.5, 8) * CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0) | |
1382 | ||
1383 | Part = Instance.new("Part") | |
1384 | Part.Name = "Rear Trunk Lining" | |
1385 | Part.BrickColor = BrickColor.new("Lime green") | |
1386 | Part.TopSurface = "Smooth" | |
1387 | Part.BottomSurface = "Smooth" | |
1388 | Part.formFactor = "Symmetric" | |
1389 | Part.Size = Vector3.new(7, 1, 1) | |
1390 | Part.Parent = Vehicle | |
1391 | Mesh = Instance.new("SpecialMesh") | |
1392 | Mesh.MeshType = "Brick" | |
1393 | Mesh.Scale = Vector3.new(1, 1, 0.5) | |
1394 | Mesh.Parent = Part | |
1395 | Weld = Instance.new("Weld") | |
1396 | Weld.Parent = Part | |
1397 | Weld.Part0 = Base | |
1398 | Weld.Part1 = Part | |
1399 | Weld.C0 = CFrame.new(0, 0.5, 11.25) | |
1400 | ||
1401 | Part = Instance.new("Part") | |
1402 | Part.Name = "Trunk 1" | |
1403 | Part.BrickColor = MasterColor | |
1404 | Part.TopSurface = "Smooth" | |
1405 | Part.BottomSurface = "Smooth" | |
1406 | Part.formFactor = "Symmetric" | |
1407 | Part.Size = Vector3.new(8, 1, 4) | |
1408 | Part.Parent = Vehicle | |
1409 | Mesh = Instance.new("SpecialMesh") | |
1410 | Mesh.MeshType = "Brick" | |
1411 | Mesh.Scale = Vector3.new(1, 0.5, 1) | |
1412 | Mesh.Parent = Part | |
1413 | Weld = Instance.new("Weld") | |
1414 | Weld.Parent = Part | |
1415 | Weld.Part0 = Base | |
1416 | Weld.Part1 = Part | |
1417 | Weld.C0 = CFrame.new(0, 2.751, 7) | |
1418 | Weld.C1 = CFrame.new(0, 0, -2.25) | |
1419 | local Open = Instance.new("ClickDetector") | |
1420 | Open.Parent = Part | |
1421 | coroutine.wrap(function(Weld2) | |
1422 | local IsOpen = false | |
1423 | local CanOpen = true | |
1424 | Open.MouseClick:connect(function() | |
1425 | if IsOpen == false and CanOpen == true then | |
1426 | CanOpen = false | |
1427 | IsOpen = true | |
1428 | for i = 0, 1, 0.05 do | |
1429 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0) | |
1430 | wait() | |
1431 | end | |
1432 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) | |
1433 | CanOpen = true | |
1434 | elseif IsOpen == true and CanOpen == true then | |
1435 | CanOpen = false | |
1436 | IsOpen = false | |
1437 | for i = 1, 0, -0.05 do | |
1438 | Weld2.C1 = CFrame.new(Weld2.C1.p) * CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0) | |
1439 | wait() | |
1440 | end | |
1441 | Weld2.C1 = CFrame.new(Weld2.C1.p) | |
1442 | CanOpen = true | |
1443 | end | |
1444 | end) | |
1445 | end)(Weld) | |
1446 | ||
1447 | Part = Instance.new("Part") | |
1448 | Part.Name = "Trunk 2" | |
1449 | Part.BrickColor = MasterColor | |
1450 | Part.TopSurface = "Smooth" | |
1451 | Part.BottomSurface = "Smooth" | |
1452 | Part.formFactor = "Symmetric" | |
1453 | Part.Size = Vector3.new(8, 3, 1) | |
1454 | Part.Parent = Vehicle | |
1455 | Mesh = Instance.new("SpecialMesh") | |
1456 | Mesh.MeshType = "Brick" | |
1457 | Mesh.Scale = Vector3.new(1, 1, 0.5) | |
1458 | Mesh.Parent = Part | |
1459 | Weld = Instance.new("Weld") | |
1460 | Weld.Parent = Part | |
1461 | Weld.Part0 = Vehicle["Trunk 1"] | |
1462 | Weld.Part1 = Part | |
1463 | Weld.C0 = CFrame.new(0, -1.25, 2.01) | |
1464 | ||
1465 | Part = Instance.new("Part") | |
1466 | Part.Name = "Left Brake Light" | |
1467 | Part.TopSurface = "Smooth" | |
1468 | Part.BottomSurface = "Smooth" | |
1469 | Part.formFactor = "Symmetric" | |
1470 | Part.Size = Vector3.new(1, 1, 1) | |
1471 | Part.Parent = Vehicle | |
1472 | Mesh = Instance.new("SpecialMesh") | |
1473 | Mesh.MeshType = "Brick" | |
1474 | Mesh.Scale = Vector3.new(0.75, 1, 0.01) | |
1475 | Mesh.Parent = Part | |
1476 | Weld = Instance.new("Weld") | |
1477 | Weld.Parent = Part | |
1478 | Weld.Part0 = Base | |
1479 | Weld.Part1 = Part | |
1480 | Weld.C0 = CFrame.new(-5, 2, 11.5) | |
1481 | coroutine.wrap(function(Part2) | |
1482 | while true do | |
1483 | if Part2:FindFirstChild("Weld") == nil or IsBraking == false then | |
1484 | Part2.Transparency = 0.75 | |
1485 | Part2.BrickColor = BrickColor.new("Really red") | |
1486 | else | |
1487 | Part2.Transparency = 0 | |
1488 | Part2.BrickColor = BrickColor.new("Lime green") | |
1489 | end | |
1490 | wait() | |
1491 | end | |
1492 | end)(Part) | |
1493 | ||
1494 | Part = Instance.new("Part") | |
1495 | Part.Name = "Left Rear Turn Signal" | |
1496 | Part.BrickColor = BrickColor.new("Institutional white") | |
1497 | Part.TopSurface = "Smooth" | |
1498 | Part.BottomSurface = "Smooth" | |
1499 | Part.formFactor = "Symmetric" | |
1500 | Part.Size = Vector3.new(1, 1, 1) | |
1501 | Part.Parent = Vehicle | |
1502 | Mesh = Instance.new("SpecialMesh") | |
1503 | Mesh.MeshType = "Brick" | |
1504 | Mesh.Scale = Vector3.new(0.5, 1.5, 0.01) | |
1505 | Mesh.Parent = Part | |
1506 | Weld = Instance.new("Weld") | |
1507 | Weld.Parent = Part | |
1508 | Weld.Part0 = Base | |
1509 | Weld.Part1 = Part | |
1510 | Weld.C0 = CFrame.new(-4.375, 1.75, 11.5) | |
1511 | ||
1512 | Part = Instance.new("Part") | |
1513 | Part.Name = "Right Brake Light" | |
1514 | Part.TopSurface = "Smooth" | |
1515 | Part.BottomSurface = "Smooth" | |
1516 | Part.formFactor = "Symmetric" | |
1517 | Part.Size = Vector3.new(1, 1, 1) | |
1518 | Part.Parent = Vehicle | |
1519 | Mesh = Instance.new("SpecialMesh") | |
1520 | Mesh.MeshType = "Brick" | |
1521 | Mesh.Scale = Vector3.new(0.75, 1, 0.01) | |
1522 | Mesh.Parent = Part | |
1523 | Weld = Instance.new("Weld") | |
1524 | Weld.Parent = Part | |
1525 | Weld.Part0 = Base | |
1526 | Weld.Part1 = Part | |
1527 | Weld.C0 = CFrame.new(5, 2, 11.5) | |
1528 | coroutine.wrap(function(Part2) | |
1529 | while true do | |
1530 | if Part2:FindFirstChild("Weld") == nil or IsBraking == false then | |
1531 | Part2.Transparency = 0.75 | |
1532 | Part2.BrickColor = BrickColor.new("Really red") | |
1533 | else | |
1534 | Part2.Transparency = 0 | |
1535 | Part2.BrickColor = BrickColor.new("Lime green") | |
1536 | end | |
1537 | wait() | |
1538 | end | |
1539 | end)(Part) | |
1540 | ||
1541 | Part = Instance.new("Part") | |
1542 | Part.Name = "Right Rear Turn Signal" | |
1543 | Part.BrickColor = BrickColor.new("Institutional white") | |
1544 | Part.TopSurface = "Smooth" | |
1545 | Part.BottomSurface = "Smooth" | |
1546 | Part.formFactor = "Symmetric" | |
1547 | Part.Size = Vector3.new(1, 1, 1) | |
1548 | Part.Parent = Vehicle | |
1549 | Mesh = Instance.new("SpecialMesh") | |
1550 | Mesh.MeshType = "Brick" | |
1551 | Mesh.Scale = Vector3.new(0.5, 1.5, 0.01) | |
1552 | Mesh.Parent = Part | |
1553 | Weld = Instance.new("Weld") | |
1554 | Weld.Parent = Part | |
1555 | Weld.Part0 = Base | |
1556 | Weld.Part1 = Part | |
1557 | Weld.C0 = CFrame.new(4.375, 1.75, 11.5) | |
1558 | ||
1559 | Part = Instance.new("Part") | |
1560 | Part.Name = "Left Reverse Light" | |
1561 | Part.TopSurface = "Smooth" | |
1562 | Part.BottomSurface = "Smooth" | |
1563 | Part.formFactor = "Symmetric" | |
1564 | Part.Size = Vector3.new(1, 1, 1) | |
1565 | Part.Parent = Vehicle | |
1566 | Mesh = Instance.new("SpecialMesh") | |
1567 | Mesh.MeshType = "Brick" | |
1568 | Mesh.Scale = Vector3.new(0.75, 0.5, 0.01) | |
1569 | Mesh.Parent = Part | |
1570 | Weld = Instance.new("Weld") | |
1571 | Weld.Parent = Part | |
1572 | Weld.Part0 = Base | |
1573 | Weld.Part1 = Part | |
1574 | Weld.C0 = CFrame.new(-5, 1.25, 11.5) | |
1575 | coroutine.wrap(function(Part2) | |
1576 | while true do | |
1577 | if Part2:FindFirstChild("Weld") == nil or ThrottlePercent >= 0 then | |
1578 | Part2.Transparency = 0.5 | |
1579 | Part2.BrickColor = BrickColor.new("White") | |
1580 | else | |
1581 | Part2.Transparency = 0 | |
1582 | Part2.BrickColor = BrickColor.new("Lime green") | |
1583 | end | |
1584 | wait() | |
1585 | end | |
1586 | end)(Part) | |
1587 | ||
1588 | Part = Instance.new("Part") | |
1589 | Part.Name = "Right Reverse Light" | |
1590 | Part.TopSurface = "Smooth" | |
1591 | Part.BottomSurface = "Smooth" | |
1592 | Part.formFactor = "Symmetric" | |
1593 | Part.Size = Vector3.new(1, 1, 1) | |
1594 | Part.Parent = Vehicle | |
1595 | Mesh = Instance.new("SpecialMesh") | |
1596 | Mesh.MeshType = "Brick" | |
1597 | Mesh.Scale = Vector3.new(0.75, 0.5, 0.01) | |
1598 | Mesh.Parent = Part | |
1599 | Weld = Instance.new("Weld") | |
1600 | Weld.Parent = Part | |
1601 | Weld.Part0 = Base | |
1602 | Weld.Part1 = Part | |
1603 | Weld.C0 = CFrame.new(5, 1.25, 11.5) | |
1604 | coroutine.wrap(function(Part2) | |
1605 | while true do | |
1606 | if Part2:FindFirstChild("Weld") == nil or ThrottlePercent >= 0 then | |
1607 | Part2.Transparency = 0.5 | |
1608 | Part2.BrickColor = BrickColor.new("White") | |
1609 | else | |
1610 | Part2.Transparency = 0 | |
1611 | Part2.BrickColor = BrickColor.new("Lime green") | |
1612 | end | |
1613 | wait() | |
1614 | end | |
1615 | end)(Part) | |
1616 | ||
1617 | Part = Instance.new("Part") | |
1618 | Part.Name = "Rear Right Wheel" | |
1619 | Part.BrickColor = BrickColor.new("Black") | |
1620 | Part.TopSurface = "Smooth" | |
1621 | Part.BottomSurface = "Smooth" | |
1622 | Part.formFactor = "Symmetric" | |
1623 | Part.Size = Vector3.new(3, 2, 3) | |
1624 | Part.Friction = TireFriction | |
1625 | Part.Elasticity = TireElasticity | |
1626 | Part.Parent = Vehicle | |
1627 | Mesh = Instance.new("CylinderMesh") | |
1628 | Mesh.Parent = Part | |
1629 | Weld = Instance.new("Weld") | |
1630 | Weld.Parent = Part | |
1631 | Weld.Part0 = Base | |
1632 | Weld.Part1 = Part | |
1633 | Weld.C0 = CFrame.new(5, 0, 8) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) | |
1634 | ||
1635 | Part = Instance.new("Part") | |
1636 | Part.Name = "Rear Left Wheel" | |
1637 | Part.BrickColor = BrickColor.new("Black") | |
1638 | Part.TopSurface = "Smooth" | |
1639 | Part.BottomSurface = "Smooth" | |
1640 | Part.formFactor = "Symmetric" | |
1641 | Part.Size = Vector3.new(3, 2, 3) | |
1642 | Part.Friction = TireFriction | |
1643 | Part.Elasticity = TireElasticity | |
1644 | Part.Parent = Vehicle | |
1645 | Mesh = Instance.new("CylinderMesh") | |
1646 | Mesh.Parent = Part | |
1647 | Weld = Instance.new("Weld") | |
1648 | Weld.Parent = Part | |
1649 | Weld.Part0 = Base | |
1650 | Weld.Part1 = Part | |
1651 | Weld.C0 = CFrame.new(-5, 0, 8) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) | |
1652 | ||
1653 | Part = Instance.new("Part") | |
1654 | Part.Name = "Front Right Wheel" | |
1655 | Part.BrickColor = BrickColor.new("Black") | |
1656 | Part.TopSurface = "Smooth" | |
1657 | Part.BottomSurface = "Smooth" | |
1658 | Part.formFactor = "Symmetric" | |
1659 | Part.Size = Vector3.new(3, 2, 3) | |
1660 | Part.Friction = TireFriction | |
1661 | Part.Elasticity = TireElasticity | |
1662 | Part.Parent = Vehicle | |
1663 | Mesh = Instance.new("CylinderMesh") | |
1664 | Mesh.Parent = Part | |
1665 | Weld = Instance.new("Weld") | |
1666 | Weld.Parent = Part | |
1667 | Weld.Part0 = Base | |
1668 | Weld.Part1 = Part | |
1669 | Weld.C0 = CFrame.new(5, 0, -4) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) | |
1670 | ||
1671 | Part = Instance.new("Part") | |
1672 | Part.Name = "Front Left Wheel" | |
1673 | Part.BrickColor = BrickColor.new("Black") | |
1674 | Part.TopSurface = "Smooth" | |
1675 | Part.BottomSurface = "Smooth" | |
1676 | Part.formFactor = "Symmetric" | |
1677 | Part.Size = Vector3.new(3, 2, 3) | |
1678 | Part.Friction = TireFriction | |
1679 | Part.Elasticity = TireElasticity | |
1680 | Part.Parent = Vehicle | |
1681 | Mesh = Instance.new("CylinderMesh") | |
1682 | Mesh.Parent = Part | |
1683 | Weld = Instance.new("Weld") | |
1684 | Weld.Parent = Part | |
1685 | Weld.Part0 = Base | |
1686 | Weld.Part1 = Part | |
1687 | Weld.C0 = CFrame.new(-5, 0, -4) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) | |
1688 | ||
1689 | Vehicle:MoveTo((workspace:FindFirstChild("koilered") == nil and Vector3.new() or workspace.koilered.Torso.CFrame.p) + Vector3.new(9, 3, 0)) | |
1690 | ||
1691 | if Wrecked == true then Health = math.random(1, MaxHealth) end | |
1692 | ||
1693 | for _, Part in pairs(Vehicle:GetChildren()) do | |
1694 | if pcall(function() x = Part.CFrame x = nil end) == true then | |
1695 | pcall(function() Part.Locked = true end) | |
1696 | if Wrecked == true then | |
1697 | pcall(function() Part.Weld.C0 = Part.Weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-7.5, 7.5)), math.rad(math.random(-7.5, 7.5)), math.rad(math.random(-7.5, 7.5))) end) | |
1698 | if math.random(1, 5) == 1 then Part.Material = "CorrodedMetal" end | |
1699 | if math.random(1, 10) == 1 then Part.BrickColor = BrickColor.new("Lime green") end | |
1700 | if math.random(1, 50) == 1 then Part.BrickColor = BrickColor.new("Really black") end | |
1701 | end | |
1702 | if not string.match(Part.Name, "Wheel") and not string.match(Part.Name, "VehicleSeat") and not string.match(Part.Name, "VehicleEngine") then | |
1703 | Part.Touched:connect(function(Hit) | |
1704 | if Hit.Parent == nil then return end | |
1705 | if Hit.Parent == Vehicle then return end | |
1706 | if Part:FindFirstChild("Weld") == nil then return end | |
1707 | local velocity1 = { | |
1708 | math.abs(Part.Velocity.x), | |
1709 | math.abs(Part.Velocity.y), | |
1710 | math.abs(Part.Velocity.z) | |
1711 | } | |
1712 | local rotvelocity1 = { | |
1713 | math.abs(Part.RotVelocity.x), | |
1714 | math.abs(Part.RotVelocity.y), | |
1715 | math.abs(Part.RotVelocity.z) | |
1716 | } | |
1717 | local velocity2 = { | |
1718 | math.abs(Hit.Velocity.x), | |
1719 | math.abs(Hit.Velocity.y), | |
1720 | math.abs(Hit.Velocity.z) | |
1721 | } | |
1722 | local rotvelocity2 = { | |
1723 | math.abs(Hit.RotVelocity.x), | |
1724 | math.abs(Hit.RotVelocity.y), | |
1725 | math.abs(Hit.RotVelocity.z) | |
1726 | } | |
1727 | for i = 1, #velocity1 do | |
1728 | local Total = math.abs(velocity1[i] - velocity2[i]) | |
1729 | if Total > ToughnessMinorDamage then | |
1730 | Health = Health - (Total / 10) | |
1731 | ThrottlePercent = ThrottlePercent * 0.9 | |
1732 | pcall(function() Part.Weld.C0 = Part.Weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10))) end) | |
1733 | pcall(function() Part.Weld.C1 = Part.Weld.C1 * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10))) end) | |
1734 | end | |
1735 | if Total > ToughnessMajorDamage and Hit:GetMass() > 3 then | |
1736 | Part:BreakJoints() | |
1737 | Part.Velocity = Part.Velocity + math.random(math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10)) | |
1738 | Part.RotVelocity = Part.RotVelocity + math.random(math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25)) | |
1739 | end | |
1740 | if Total > math.random(50, 75) and Hit.Name ~= "VehicleEngine" and Hit.Name ~= "VehicleBase" then | |
1741 | Hit:BreakJoints() | |
1742 | end | |
1743 | end | |
1744 | for i = 1, #rotvelocity1 do | |
1745 | local Total = math.abs(velocity1[i] - velocity2[i]) | |
1746 | if Total > ToughnessMinorDamage / 1.5 then | |
1747 | Health = Health - (Total / 10) | |
1748 | ThrottlePercent = ThrottlePercent * 0.9 | |
1749 | pcall(function() Part.Weld.C0 = Part.Weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10))) end) | |
1750 | pcall(function() Part.Weld.C1 = Part.Weld.C1 * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10)), math.rad(math.random(-Total / 10, Total / 10))) end) | |
1751 | end | |
1752 | if Total > ToughnessMajorDamage / 1.5 and Hit:GetMass() > 3 then | |
1753 | Part:BreakJoints() | |
1754 | Part.Velocity = Part.Velocity + math.random(math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10)) | |
1755 | Part.RotVelocity = Part.RotVelocity + math.random(math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25)) | |
1756 | end | |
1757 | if Total > math.random(50, 75) and Hit.Name ~= "VehicleEngine" and Hit.Name ~= "VehicleBase" then | |
1758 | Hit:BreakJoints() | |
1759 | end | |
1760 | end | |
1761 | end) | |
1762 | pcall(function() | |
1763 | Part.ChildRemoved:connect(function(Object) | |
1764 | if Object.Name == "Weld" then | |
1765 | Health = Health - 10 | |
1766 | end | |
1767 | end) | |
1768 | end) | |
1769 | end | |
1770 | end | |
1771 | end | |
1772 | ||
1773 | while true do | |
1774 | IsBraking = false | |
1775 | if ThrottlePercent < 0.25 then | |
1776 | Drifting = false | |
1777 | DriftCheck = 0 | |
1778 | end | |
1779 | if Seat.Throttle == 1 then | |
1780 | if ThrottlePercent < 0 then | |
1781 | ThrottlePercent = ThrottlePercent + BrakePower | |
1782 | IsBraking = true | |
1783 | else | |
1784 | if time() - DriftCheck < 0.25 and Drifting == false then | |
1785 | coroutine.wrap(function() | |
1786 | DriftCheck = 0 | |
1787 | Drifting = true | |
1788 | local OldAcceleration = Acceleration | |
1789 | local OldSteerDifficulty = SteerDifficulty | |
1790 | local OldSteerPower = SteerPower | |
1791 | Acceleration = DriftAcceleration | |
1792 | SteerDifficulty = DriftSteerDifficulty | |
1793 | SteerPower = DriftSteerPower | |
1794 | local EffectHolder1 = Instance.new("Part") | |
1795 | EffectHolder1.Name = "" | |
1796 | EffectHolder1.CanCollide = false | |
1797 | EffectHolder1.Anchored = true | |
1798 | EffectHolder1.formFactor = "Symmetric" | |
1799 | EffectHolder1.Size = Vector3.new(1, 1, 1) | |
1800 | EffectHolder1.TopSurface = 0 | |
1801 | EffectHolder1.BottomSurface = 0 | |
1802 | EffectHolder1.Transparency = 1 | |
1803 | EffectHolder1.Parent = Vehicle | |
1804 | local Smoke = Instance.new("Smoke") | |
1805 | Smoke.Color = Color3.new(0.9, 0.9, 0.9) | |
1806 | Smoke.RiseVelocity = 15 | |
1807 | Smoke.Size = 10 | |
1808 | Smoke.Parent = EffectHolder1 | |
1809 | local EffectHolder2 = Instance.new("Part") | |
1810 | EffectHolder2.Name = "" | |
1811 | EffectHolder2.CanCollide = false | |
1812 | EffectHolder2.Anchored = true | |
1813 | EffectHolder2.formFactor = "Symmetric" | |
1814 | EffectHolder2.Size = Vector3.new(1, 1, 1) | |
1815 | EffectHolder2.TopSurface = 0 | |
1816 | EffectHolder2.BottomSurface = 0 | |
1817 | EffectHolder2.Transparency = 1 | |
1818 | EffectHolder2.Parent = Vehicle | |
1819 | local Smoke = Instance.new("Smoke") | |
1820 | Smoke.Color = Color3.new(0.9, 0.9, 0.9) | |
1821 | Smoke.RiseVelocity = 15 | |
1822 | Smoke.Size = 10 | |
1823 | Smoke.Parent = EffectHolder2 | |
1824 | while Drifting == true do | |
1825 | if Vehicle:FindFirstChild("Rear Left Wheel") ~= nil then | |
1826 | EffectHolder1.CFrame = Vehicle["Rear Left Wheel"].CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) | |
1827 | else | |
1828 | EffectHolder1.Smoke.Enabled = false | |
1829 | end | |
1830 | if Vehicle:FindFirstChild("Rear Right Wheel") ~= nil then | |
1831 | EffectHolder2.CFrame = Vehicle["Rear Right Wheel"].CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) | |
1832 | else | |
1833 | EffectHolder2.Smoke.Enabled = false | |
1834 | end | |
1835 | wait() | |
1836 | end | |
1837 | Acceleration = OldAcceleration | |
1838 | SteerDifficulty = OldSteerDifficulty | |
1839 | SteerPower = OldSteerPower | |
1840 | EffectHolder1.Smoke.Enabled = false | |
1841 | EffectHolder2.Smoke.Enabled = false | |
1842 | wait(7.5) | |
1843 | EffectHolder1:Remove() | |
1844 | EffectHolder2:Remove() | |
1845 | end)() | |
1846 | end | |
1847 | ThrottlePercent = ThrottlePercent + Acceleration | |
1848 | end | |
1849 | elseif Seat.Throttle == -1 then | |
1850 | Drifting = false | |
1851 | if ThrottlePercent > 0 then | |
1852 | ThrottlePercent = ThrottlePercent - BrakePower | |
1853 | IsBraking = true | |
1854 | DriftCheck = time() | |
1855 | else | |
1856 | ThrottlePercent = ThrottlePercent - Acceleration | |
1857 | end | |
1858 | else | |
1859 | if ThrottlePercent < 0 then | |
1860 | ThrottlePercent = ThrottlePercent + Deceleration | |
1861 | elseif ThrottlePercent > 0 then | |
1862 | ThrottlePercent = ThrottlePercent - Deceleration | |
1863 | end | |
1864 | if ThrottlePercent > -Deceleration * 1.1 and ThrottlePercent < Deceleration * 1.1 then | |
1865 | ThrottlePercent = 0 | |
1866 | end | |
1867 | end | |
1868 | if ThrottlePercent > 1 then ThrottlePercent = 1 end | |
1869 | if ThrottlePercent < -1 then ThrottlePercent = -1 end | |
1870 | if ThrottlePercent ~= 0 and (pcall(function() x = Vehicle["Rear Left Wheel"].Weld x = nil end) == true or pcall(function() x = Vehicle["Rear Right Wheel"].Weld x = nil end) == true) and pcall(function() x = Vehicle.VehicleEngine.Weld x = nil end) == true and Health > 0 then | |
1871 | Thrust.maxForce = Vector3.new(math.huge, 0, math.huge) | |
1872 | Thrust.velocity = Base.CFrame.lookVector * (TopSpeed * ThrottlePercent) | |
1873 | else | |
1874 | Thrust.maxForce = Vector3.new() | |
1875 | end | |
1876 | if Seat.Steer == 1 then | |
1877 | SteerPercent = SteerPercent - (SteerDifficulty * (1 - (math.abs(ThrottlePercent) / 10))) | |
1878 | elseif Seat.Steer == -1 then | |
1879 | SteerPercent = SteerPercent + (SteerDifficulty * (1 - (math.abs(ThrottlePercent) / 10))) | |
1880 | else | |
1881 | if SteerPercent < 0 then | |
1882 | SteerPercent = SteerPercent + SteerDifficulty | |
1883 | elseif SteerPercent > 0 then | |
1884 | SteerPercent = SteerPercent - SteerDifficulty | |
1885 | end | |
1886 | if SteerPercent > -SteerDifficulty * 1.1 and SteerPercent < SteerDifficulty * 1.1 then | |
1887 | SteerPercent = 0 | |
1888 | Drifting = false | |
1889 | end | |
1890 | end | |
1891 | if SteerPercent > 1 then SteerPercent = 1 end | |
1892 | if SteerPercent < -1 then SteerPercent = -1 end | |
1893 | if SteerPercent ~= 0 and (pcall(function() x = Vehicle["Front Left Wheel"].Weld x = nil end) == true or pcall(function() x = Vehicle["Front Right Wheel"].Weld x = nil end) == true) and Health > 0 then | |
1894 | Steer.maxTorque = Vector3.new(0, math.huge, 0) | |
1895 | Steer.cframe = (Base.CFrame - Base.CFrame.p) * CFrame.fromEulerAnglesXYZ(0, math.rad((SteerPercent * SteerPower) * ((ThrottlePercent * 10) > 1 and 1 or (ThrottlePercent * 10))), 0) | |
1896 | ThrottlePercent = ThrottlePercent - ((Acceleration * 0.95) * (1 - math.abs(SteerPercent))) | |
1897 | local SteerAngle = SteerPercent * (SteerPower * 1.5) | |
1898 | if SteerAngle > 80 then SteerAngle = 80 end | |
1899 | if SteerAngle < -80 then SteerAngle = -80 end | |
1900 | pcall(function() Vehicle["Front Left Wheel"].Weld.C0 = CFrame.new(Vehicle["Front Left Wheel"].Weld.C0.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(SteerAngle), math.rad(90)) end) | |
1901 | pcall(function() Vehicle["Front Right Wheel"].Weld.C0 = CFrame.new(Vehicle["Front Right Wheel"].Weld.C0.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(SteerAngle), math.rad(90)) end) | |
1902 | else | |
1903 | Steer.maxTorque = Vector3.new() | |
1904 | Steer.cframe = CFrame.new() | |
1905 | pcall(function() Vehicle["Front Left Wheel"].Weld.C0 = CFrame.new(Vehicle["Front Left Wheel"].Weld.C0.p) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) end) | |
1906 | pcall(function() Vehicle["Front Right Wheel"].Weld.C0 = CFrame.new(Vehicle["Front Right Wheel"].Weld.C0.p) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90)) end) | |
1907 | end | |
1908 | if Seat:FindFirstChild("SeatWeld") ~= nil and Driver == nil then | |
1909 | local Part1 = Seat.SeatWeld.Part1 | |
1910 | if Part1 ~= nil then | |
1911 | Driver = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) | |
1912 | if Driver ~= nil then | |
1913 | local PlayerGui = Driver:FindFirstChild("PlayerGui") | |
1914 | if PlayerGui == nil then PlayerGui = Instance.new("PlayerGui", Driver) end | |
1915 | local DriverGui = Instance.new("ScreenGui", PlayerGui) | |
1916 | DriverGui.Name = "DriverGui" | |
1917 | local Frame = Instance.new("Frame") | |
1918 | Frame.Name = "Content" | |
1919 | Frame.Size = UDim2.new(1, 0, 0, 100) | |
1920 | Frame.Position = UDim2.new(0, 0, 1, -100) | |
1921 | Frame.BorderSizePixel = 1 | |
1922 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
1923 | Frame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15) | |
1924 | Frame.Parent = DriverGui | |
1925 | local TextLabel = Instance.new("TextLabel") | |
1926 | TextLabel.Name = "SpeedText1" | |
1927 | TextLabel.Size = UDim2.new(0, 85, 0, 15) | |
1928 | TextLabel.Position = UDim2.new(0, 15, 0, 7.5) | |
1929 | TextLabel.BorderSizePixel = 0 | |
1930 | TextLabel.BackgroundTransparency = 1 | |
1931 | TextLabel.TextColor3 = Color3.new(1, 1, 1) | |
1932 | TextLabel.Text = "Speed" | |
1933 | TextLabel.TextXAlignment = "Left" | |
1934 | TextLabel.FontSize = "Size12" | |
1935 | TextLabel.Parent = DriverGui.Content | |
1936 | local TextLabel = Instance.new("TextLabel") | |
1937 | TextLabel.Name = "SpeedText2" | |
1938 | TextLabel.Size = UDim2.new(0, 85, 0, 15) | |
1939 | TextLabel.Position = UDim2.new(0, 15, 0, 7.5 + 15) | |
1940 | TextLabel.BorderSizePixel = 0 | |
1941 | TextLabel.BackgroundTransparency = 1 | |
1942 | TextLabel.TextColor3 = Color3.new(1, 1, 1) | |
1943 | TextLabel.Text = "Bricks/sec." | |
1944 | TextLabel.TextXAlignment = "Left" | |
1945 | TextLabel.FontSize = "Size12" | |
1946 | TextLabel.Parent = DriverGui.Content | |
1947 | for i = 0, 1, 0.1 do | |
1948 | local TextLabel = Instance.new("TextLabel") | |
1949 | TextLabel.Name = "SpeedTextInc" ..i | |
1950 | TextLabel.Size = UDim2.new(0, 0, 0, 15) | |
1951 | TextLabel.Position = UDim2.new(0, 92 + (i * 200), 0, 37.5) | |
1952 | TextLabel.BorderSizePixel = 1 | |
1953 | TextLabel.BackgroundTransparency = 0 | |
1954 | TextLabel.TextColor3 = Color3.new(1, 1, 1) | |
1955 | TextLabel.Text = math.floor(TopSpeed * i) | |
1956 | TextLabel.TextXAlignment = "Left" | |
1957 | TextLabel.Parent = DriverGui.Content | |
1958 | end | |
1959 | local Frame = Instance.new("Frame") | |
1960 | Frame.Name = "SpeedBack" | |
1961 | Frame.Size = UDim2.new(0, 200, 0, 30) | |
1962 | Frame.Position = UDim2.new(0, 100, 0, 7.5) | |
1963 | Frame.BorderSizePixel = 1 | |
1964 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
1965 | Frame.BackgroundColor3 = Color3.new(0, 0, 0) | |
1966 | Frame.Parent = DriverGui.Content | |
1967 | local Frame = Instance.new("Frame") | |
1968 | Frame.Name = "SpeedFront" | |
1969 | Frame.BorderSizePixel = 1 | |
1970 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
1971 | Frame.BackgroundColor3 = Color3.new(0, 0, 0.9) | |
1972 | Frame.Parent = DriverGui.Content | |
1973 | coroutine.wrap(function() | |
1974 | while DriverGui.Parent ~= nil do | |
1975 | DriverGui.Content.SpeedFront.Size = DriverGui.Content.SpeedBack.Size - UDim2.new(0, DriverGui.Content.SpeedBack.Size.X.Offset * (1 - math.abs(ThrottlePercent)), 0, 0) | |
1976 | DriverGui.Content.SpeedFront.Position = DriverGui.Content.SpeedBack.Position | |
1977 | wait() | |
1978 | end | |
1979 | end)() | |
1980 | local TextLabel = Instance.new("TextLabel") | |
1981 | TextLabel.Name = "DamageText" | |
1982 | TextLabel.Size = UDim2.new(0, 85, 0, 30) | |
1983 | TextLabel.Position = UDim2.new(0, 215, 0, 57.5) | |
1984 | TextLabel.BorderSizePixel = 0 | |
1985 | TextLabel.BackgroundTransparency = 1 | |
1986 | TextLabel.TextColor3 = Color3.new(1, 1, 1) | |
1987 | TextLabel.Text = "Damage" | |
1988 | TextLabel.TextXAlignment = "Left" | |
1989 | TextLabel.FontSize = "Size12" | |
1990 | TextLabel.Parent = DriverGui.Content | |
1991 | local Frame = Instance.new("Frame") | |
1992 | Frame.Name = "DamageBack" | |
1993 | Frame.Size = UDim2.new(0, 250, 0, 30) | |
1994 | Frame.Position = UDim2.new(0, 300, 0, 57.5) | |
1995 | Frame.BorderSizePixel = 1 | |
1996 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
1997 | Frame.BackgroundColor3 = Color3.new(0, 0.5, 0) | |
1998 | Frame.Parent = DriverGui.Content | |
1999 | local Frame = Instance.new("Frame") | |
2000 | Frame.Name = "DamageFront" | |
2001 | Frame.BorderSizePixel = 1 | |
2002 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
2003 | Frame.BackgroundColor3 = Color3.new(0.9, 0, 0) | |
2004 | Frame.Parent = DriverGui.Content | |
2005 | coroutine.wrap(function() | |
2006 | local i = math.pi * 1.5 | |
2007 | while DriverGui.Parent ~= nil do | |
2008 | DriverGui.Content.DamageFront.Size = DriverGui.Content.DamageBack.Size - UDim2.new(0, DriverGui.Content.DamageBack.Size.X.Offset * (1 - ((MaxHealth - Health) / MaxHealth)), 0, 0) | |
2009 | DriverGui.Content.DamageFront.Position = DriverGui.Content.DamageBack.Position | |
2010 | if Health < MaxHealth * 0.15 then | |
2011 | i = i + 0.4 | |
2012 | elseif Health < MaxHealth * 0.2 then | |
2013 | i = i + 0.25 | |
2014 | elseif Health < MaxHealth * 0.3 then | |
2015 | i = i + 0.1 | |
2016 | elseif Health < MaxHealth * 0.4 then | |
2017 | i = i + 0.075 | |
2018 | end | |
2019 | DriverGui.Content.DamageFront.BackgroundColor3 = Color3.new(1 - ((math.sin(i) + 1) / 2), 0, 0) | |
2020 | DriverGui.Content.DamageBack.BackgroundColor3 = Color3.new(0, 0.5 - (((math.sin(i) + 1) / 2) * 0.5), 0) | |
2021 | wait() | |
2022 | end | |
2023 | end)() | |
2024 | end | |
2025 | end | |
2026 | elseif Seat:FindFirstChild("SeatWeld") == nil and Driver ~= nil then | |
2027 | if Driver:FindFirstChild("PlayerGui") ~= nil then | |
2028 | if Driver.PlayerGui:FindFirstChild("DriverGui") ~= nil then | |
2029 | Driver.PlayerGui.DriverGui:Remove() | |
2030 | end | |
2031 | end | |
2032 | Driver = nil | |
2033 | end | |
2034 | if Vehicle:FindFirstChild("VehicleEngine") ~= nil then | |
2035 | if Vehicle.VehicleEngine:FindFirstChild("Weld") == nil then | |
2036 | Health = 0 | |
2037 | end | |
2038 | if pcall(function() x = EffectHolder.Parent x = nil end) == false then | |
2039 | EffectHolder = Instance.new("Part") | |
2040 | EffectHolder.Name = "" | |
2041 | EffectHolder.CanCollide = false | |
2042 | EffectHolder.Anchored = true | |
2043 | EffectHolder.formFactor = "Symmetric" | |
2044 | EffectHolder.Size = Vector3.new(1, 1, 1) | |
2045 | EffectHolder.TopSurface = 0 | |
2046 | EffectHolder.BottomSurface = 0 | |
2047 | EffectHolder.Transparency = 1 | |
2048 | EffectHolder.Parent = Vehicle | |
2049 | end | |
2050 | EffectHolder.CFrame = CFrame.new(Vehicle.VehicleEngine.CFrame.p) | |
2051 | for _, Part in pairs(EffectHolder:GetChildren()) do | |
2052 | pcall(function() Part.Enabled = false end) | |
2053 | end | |
2054 | if Health <= 0 then | |
2055 | if EffectHolder:FindFirstChild("Smoke 0") == nil then | |
2056 | local Smoke = Instance.new("Smoke") | |
2057 | Smoke.Name = "Smoke 0" | |
2058 | Smoke.Color = Color3.new(0.05, 0.05, 0.05) | |
2059 | Smoke.RiseVelocity = 12.5 | |
2060 | Smoke.Size = 12.5 | |
2061 | Smoke.Parent = EffectHolder | |
2062 | end | |
2063 | if EffectHolder:FindFirstChild("Fire 0") == nil then | |
2064 | local Fire = Instance.new("Fire") | |
2065 | Fire.Name = "Fire 0" | |
2066 | Fire.Heat = 10 | |
2067 | Fire.Size = 20 | |
2068 | Fire.Parent = EffectHolder | |
2069 | end | |
2070 | EffectHolder["Smoke 0"].Enabled = true | |
2071 | EffectHolder["Fire 0"].Enabled = true | |
2072 | elseif Health < MaxHealth * 0.15 then | |
2073 | if EffectHolder:FindFirstChild("Smoke 1") == nil then | |
2074 | local Smoke = Instance.new("Smoke") | |
2075 | Smoke.Name = "Smoke 1" | |
2076 | Smoke.Color = Color3.new(0.25, 0.25, 0.25) | |
2077 | Smoke.RiseVelocity = 10 | |
2078 | Smoke.Size = 10 | |
2079 | Smoke.Parent = EffectHolder | |
2080 | end | |
2081 | if EffectHolder:FindFirstChild("Fire 1") == nil then | |
2082 | local Fire = Instance.new("Fire") | |
2083 | Fire.Name = "Fire 1" | |
2084 | Fire.Heat = 5 | |
2085 | Fire.Size = 10 | |
2086 | Fire.Parent = EffectHolder | |
2087 | end | |
2088 | EffectHolder["Smoke 1"].Enabled = true | |
2089 | EffectHolder["Fire 1"].Enabled = true | |
2090 | elseif Health < MaxHealth * 0.2 then | |
2091 | if EffectHolder:FindFirstChild("Smoke 2") == nil then | |
2092 | local Smoke = Instance.new("Smoke") | |
2093 | Smoke.Name = "Smoke 2" | |
2094 | Smoke.Color = Color3.new(0.5, 0.5, 0.5) | |
2095 | Smoke.RiseVelocity = 9 | |
2096 | Smoke.Size = 7.5 | |
2097 | Smoke.Parent = EffectHolder | |
2098 | end | |
2099 | EffectHolder["Smoke 2"].Enabled = true | |
2100 | elseif Health < MaxHealth * 0.3 then | |
2101 | if EffectHolder:FindFirstChild("Smoke 3") == nil then | |
2102 | local Smoke = Instance.new("Smoke") | |
2103 | Smoke.Name = "Smoke 3" | |
2104 | Smoke.Color = Color3.new(0.75, 0.75, 0.75) | |
2105 | Smoke.RiseVelocity = 7.5 | |
2106 | Smoke.Size = 5 | |
2107 | Smoke.Parent = EffectHolder | |
2108 | end | |
2109 | EffectHolder["Smoke 3"].Enabled = true | |
2110 | elseif Health < MaxHealth * 0.4 then | |
2111 | if EffectHolder:FindFirstChild("Smoke 4") == nil then | |
2112 | local Smoke = Instance.new("Smoke") | |
2113 | Smoke.Name = "Smoke 4" | |
2114 | Smoke.Color = Color3.new(1, 1, 1) | |
2115 | Smoke.RiseVelocity = 5 | |
2116 | Smoke.Size = 3 | |
2117 | Smoke.Parent = EffectHolder | |
2118 | end | |
2119 | EffectHolder["Smoke 4"].Enabled = true | |
2120 | end | |
2121 | else | |
2122 | Health = 0 | |
2123 | if EffectHolder ~= nil then | |
2124 | EffectHolder:Remove() | |
2125 | EffectHolder = nil | |
2126 | end | |
2127 | end | |
2128 | if Health <= 0 then | |
2129 | Health = 0 | |
2130 | ThrottlePercent = 0 | |
2131 | if Vehicle:FindFirstChild("VehicleEngine") ~= nil then | |
2132 | if math.random(1, 1000) == 1 or Vehicle.VehicleEngine:FindFirstChild("Weld") == nil then | |
2133 | local Explosion = Instance.new("Explosion") | |
2134 | Explosion.BlastPressure = 5000 * ToughnessMajorDamage | |
2135 | Explosion.BlastRadius = ToughnessMajorDamage / 10 | |
2136 | Explosion.Position = Vehicle.VehicleEngine.CFrame.p | |
2137 | Explosion.Parent = game:GetService("Workspace") | |
2138 | Vehicle.VehicleEngine.Name = "Exploded VehicleEngine" | |
2139 | end | |
2140 | end | |
2141 | end | |
2142 | wait() | |
2143 | end |