Advertisement
therainbowcreeperRBX

Truck fe

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