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