Advertisement
Guest User

Untitled

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