TheUnknownDiscord

jeep

Apr 4th, 2022 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.48 KB | None | 0 0
  1. local PhysicsService = game:GetService("PhysicsService")
  2. local pards = {}
  3. local pards2 = {}
  4. local car = "car"
  5. local wheels = "wheels"
  6. pcall(function()
  7.  
  8. -- Create two collision groups
  9. PhysicsService:CreateCollisionGroup(car)
  10. PhysicsService:CreateCollisionGroup(wheels)
  11. PhysicsService:SetPartCollisionGroup(pards, car)
  12. PhysicsService:SetPartCollisionGroup(pards2, wheels)
  13.  
  14. PhysicsService:CollisionGroupSetCollidable(car, wheels, false)
  15. end)
  16. function suspension(what,cf,mot,dir,mass)
  17. local a = Instance.new("Part", script)
  18. local a2 = Instance.new("Part", script)
  19. local a3 = Instance.new("Part", script)
  20. a.Locked = true
  21. a2.Locked = true
  22. a3.Locked = true
  23. PhysicsService:SetPartCollisionGroup(a, wheels)
  24. PhysicsService:SetPartCollisionGroup(a2, wheels)
  25. PhysicsService:SetPartCollisionGroup(a3, wheels)
  26. a2.Name = "the"
  27. a3.Name = "the"
  28. a.Name = "the"
  29. local density = 1
  30. local friction = 1.5
  31. local elasticity = 0
  32. local frictionWeight = 10000
  33. local elasticityWeight = 100000
  34. local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
  35. a2.CustomPhysicalProperties = physProperties
  36. a.Size = Vector3.new(1,1,1)
  37. a2.Size = Vector3.new(1.125,3.125,3.125)
  38. a2.Shape = "Cylinder"
  39. a2.Material = "Plastic"
  40. a3.Size = Vector3.new(0.125,1.75,1.75)
  41. a3.Shape = "Cylinder"
  42. a3.CanCollide = false
  43. a3.Material = "SmoothPlastic"
  44. a3.Color = Color3.fromRGB(163,162,165)
  45. a2.Color = Color3.fromRGB(27,42,53)
  46. local weld = Instance.new("Weld",a2)
  47. weld.Part0 = a3
  48. weld.Part1 = a2
  49. a.CFrame = what.CFrame * cf:Inverse()
  50. a.Anchored = true
  51. a2.CFrame = what.CFrame * cf:Inverse() * CFrame.new(1,0,0)
  52. a2.Anchored = true
  53. a.Transparency = 1
  54. a.CanCollide = false
  55. local mesh = Instance.new("SpecialMesh",a2)
  56. mesh.Scale = Vector3.new(0.825,0.725,0.725)
  57. mesh.MeshId = "rbxassetid://432499736"
  58. local mesh2 = Instance.new("SpecialMesh",a3)
  59. mesh2.Scale = Vector3.new(0.675,0.675,0.675)
  60. mesh2.MeshId = "rbxassetid://432499736"
  61. local at0 = Instance.new("Attachment" , a)
  62. if not mot then
  63. at0.CFrame = CFrame.new(0.5,-1,0) * CFrame.Angles(0,0,math.rad(90))
  64. else
  65. at0.CFrame = CFrame.new(2,-1,0) * CFrame.Angles(0,0,math.rad(90))
  66. end
  67. local at1 = Instance.new("Attachment" , a2)
  68. local at2 = Instance.new("Attachment" , a)
  69. at2.CFrame = CFrame.Angles(0,0,math.rad(90)) * CFrame.new(1,0,0)
  70. local pe = Instance.new("ParticleEmitter", at0)
  71. pe.LightEmission = 0
  72. pe.LightInfluence = 1
  73. pe.EmissionDirection = dir
  74. pe.VelocityInheritance = 0.35
  75. pe.Orientation = Enum.ParticleOrientation.FacingCamera
  76. pe.Size = NumberSequence.new(0.85,1.25)
  77. pe.Texture = "rbxassetid://34098552"
  78. pe.Transparency = NumberSequence.new(0.4,0.6)
  79. pe.Lifetime = NumberRange.new(1,1.25)
  80. pe.Rate = 200
  81. pe.Rotation = NumberRange.new(math.random(-360,360))
  82. pe.RotSpeed = NumberRange.new(10)
  83. pe.Speed = NumberRange.new(5)
  84. pe.SpreadAngle = Vector2.new(-15,15)
  85. pe.Drag = NumberRange.new(1)
  86. pe.Enabled = false
  87. coroutine.wrap(function()
  88. while a3.Parent ~= nil do
  89. task.wait()
  90. if a3.Velocity.Magnitude >= 2 then
  91. pe.Enabled = true
  92. else
  93. pe.Enabled = false
  94. end
  95. end
  96. end)()
  97. local prism = Instance.new("CylindricalConstraint" , a)
  98. prism.Attachment0 = at0
  99. prism.InclinationAngle = 90
  100. prism.Attachment1 = at1
  101. prism.LimitsEnabled = true
  102. prism.LowerLimit = -2.5
  103. prism.UpperLimit = 1.5
  104. prism.Restitution = 0
  105. local spring = Instance.new("SpringConstraint" , a)
  106. spring.Attachment0 = at1
  107. spring.Attachment1 = at2
  108. spring.Stiffness = 300000
  109. if not mot then
  110. spring.FreeLength = (3 * 0.5) * 0.5
  111. else
  112. spring.FreeLength = 3.5
  113. end
  114. spring.Enabled = true
  115. spring.Damping = 400
  116. prism.AngularActuatorType = "Motor"
  117. prism.MotorMaxAngularAcceleration = 1000
  118. prism.MotorMaxTorque = math.huge
  119. wait()
  120. a2.Anchored = false
  121. a.Anchored = false
  122. local wel = Instance.new("Weld",what)
  123. wel.Part0 = a
  124. wel.Part1 = what
  125. wel.C0 = cf
  126. return prism
  127. end
  128. part = Instance.new("VehicleSeat",script)
  129. part.Anchored = true
  130. part.CFrame = owner.Character.Head.CFrame * CFrame.new(0,-2,-2) * CFrame.Angles(0,math.rad(-90),0)
  131. local a2 = Instance.new("Part", script)
  132. local a3 = Instance.new("Part", script)
  133. a3.Locked = true
  134. a2.Locked = true
  135. a2.Size = Vector3.new(1.125,3.125,3.125)
  136. a2.Shape = "Cylinder"
  137. a2.Material = "Plastic"
  138. a3.Size = Vector3.new(0.125,1.75,1.75)
  139. a3.Shape = "Cylinder"
  140. a3.CanCollide = false
  141. a3.Material = "SmoothPlastic"
  142. local mesh = Instance.new("SpecialMesh",a2)
  143. mesh.Scale = Vector3.new(0.825,0.725,0.725)
  144. mesh.MeshId = "rbxassetid://432499736"
  145. local mesh2 = Instance.new("SpecialMesh",a3)
  146. mesh2.Scale = Vector3.new(0.675,0.675,0.675)
  147. mesh2.MeshId = "rbxassetid://432499736"
  148. a3.Anchored = true
  149. a2.Anchored = true
  150. a3.CFrame = owner.Character.Head.CFrame * CFrame.new(-8.5,0.5,-2) * CFrame.Angles(0,0,math.rad(-5))
  151. a2.CFrame = owner.Character.Head.CFrame * CFrame.new(-8.5,0.5,-2) * CFrame.Angles(0,0,math.rad(-5))
  152. a3.Color = Color3.fromRGB(163,162,165)
  153. a2.Color = Color3.fromRGB(27,42,53)
  154. part36 = Instance.new("Seat",script)
  155. part36.Anchored = true
  156. part36.CFrame = owner.Character.Head.CFrame * CFrame.new(-6,-1,0)
  157. part36.Size = Vector3.new(5,1,3)
  158. part37 = Instance.new("Seat",script)
  159. part37.Anchored = true
  160. part37.CFrame = owner.Character.Head.CFrame * CFrame.new(-6,-1,-4) * CFrame.Angles(0,math.rad(180),0)
  161. part37.Size = Vector3.new(5,1,3)
  162. part.Size = Vector3.new(7.5,2,6)
  163. part31 = Instance.new("Part",script)
  164. part31.Anchored = true
  165. local idle = Instance.new("Sound",part)
  166. idle.Looped = true
  167. idle.SoundId = "rbxassetid://520998094"
  168. idle.Volume = 0
  169. idle:Play()
  170. local sound = Instance.new("Sound",part)
  171. sound.Looped = true
  172. sound.Volume = 0
  173. sound.SoundId = "rbxassetid://6851694831"
  174. local start = Instance.new("Sound",part)
  175. start.Volume = 2
  176. start.SoundId = "rbxassetid://9075587875"
  177. local tweenService = game:GetService("TweenService")
  178. local timeToFade = 1.5
  179. local object = start
  180. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  181. local goal = {}
  182. goal.Volume = 2
  183. local tween = tweenService:Create(object, tweenInfo, goal)
  184. sound:Play()
  185. part31.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-2)
  186. part31.Size = Vector3.new(6,4,7.5)
  187. local pard2 = Instance.new("Part",script)
  188. pard2.Anchored = true
  189. pard2.CFrame = owner.Character.Head.CFrame * CFrame.new(5,-0.25 + 1,-2)
  190. pard2.Size = Vector3.new(5.5,1.75,7)
  191. local pard3 = Instance.new("Part",script)
  192. pard3.Anchored = true
  193. pard3.CFrame = owner.Character.Head.CFrame * CFrame.new(4.25,0.65 + 1,-2)
  194. pard3.Size = Vector3.new(3,0.25,6)
  195. local pard4 = Instance.new("Part",script)
  196. pard4.Anchored = true
  197. pard4.CFrame = owner.Character.Head.CFrame * CFrame.new(7.75,-1 + 1,-2)
  198. pard4.Size = Vector3.new(0.75,2.75,7)
  199. part5 = Instance.new("Part",script)
  200. part5.Anchored = true
  201. part5.CFrame = owner.Character.Head.CFrame * CFrame.new(6,-0.75 + 1,-5.75)
  202. part5.Size = Vector3.new(3.75,0.75,1.125)
  203. part6 = Instance.new("Part",script)
  204. part6.Anchored = true
  205. part6.CFrame = owner.Character.Head.CFrame * CFrame.new(6,-0.75 + 1,1.75)
  206. part6.Size = Vector3.new(3.75,0.75,1.125)
  207. part7 = Instance.new("Part",script)
  208. part7.Anchored = true
  209. part7.CFrame = owner.Character.Head.CFrame * CFrame.new(-5.5,-1 + 1,-2)
  210. part7.Size = Vector3.new(4.75,0.75,8)
  211. part8 = Instance.new("Part",script)
  212. part8.Anchored = true
  213. part8.CFrame = owner.Character.Head.CFrame * CFrame.new(-7.25,-1.75 + 1,-2)
  214. part8.Size = Vector3.new(1.75,2.5,8.25)
  215. part9 = Instance.new("Part",script)
  216. part9.Anchored = true
  217. part9.CFrame = owner.Character.Head.CFrame * CFrame.new(7.95,-1.95 + 1,-2)
  218. part9.Size = Vector3.new(1.25,0.75,8.25)
  219. part10 = Instance.new("Part",script)
  220. part10.Anchored = true
  221. part10.CFrame = owner.Character.Head.CFrame * CFrame.new(-8,-2.5 + 1,-2)
  222. part10.Size = Vector3.new(1,0.75,8.25)
  223. part11 = Instance.new("Part",script)
  224. part11.Anchored = true
  225. part11.CFrame = owner.Character.Head.CFrame * CFrame.new(-7.65,-1 + 1,-2) * CFrame.Angles(0,0,math.rad(-6.5))
  226. part11.Size = Vector3.new(1,3,7)
  227. part12 = Instance.new("Part",script)
  228. part12.Anchored = true
  229. part12.CFrame = owner.Character.Head.CFrame * CFrame.new(-7.05,0.75 + 1,-2) * CFrame.Angles(0,0,math.rad(-15))
  230. part12.Size = Vector3.new(1.5,2,6.25)
  231. part13 = Instance.new("Part",script)
  232. part13.Anchored = true
  233. part13.CFrame = owner.Character.Head.CFrame * CFrame.new(-6.85,1.5 + 1,-2) * CFrame.Angles(0,0,math.rad(-16.5))
  234. part13.Size = Vector3.new(1.5,2,6)
  235. part14 = Instance.new("Part",script)
  236. part14.Anchored = true
  237. part14.CFrame = owner.Character.Head.CFrame * CFrame.new(-3.125,2.65 + 1,-2)
  238. part14.Size = Vector3.new(8.175,0.35,5.75)
  239. part15 = Instance.new("Part",script)
  240. part15.Anchored = true
  241. part15.CFrame = owner.Character.Head.CFrame * CFrame.new(-3.5,2.85 + 1,-2)
  242. part15.Size = Vector3.new(7.25,0.35,4.75)
  243. part16 = Instance.new("Part",script)
  244. part16.Anchored = true
  245. part16.CFrame = owner.Character.Head.CFrame * CFrame.new(3.5,0.75 + 1,-2)
  246. part16.Size = Vector3.new(1.5,0.25,4)
  247. part17 = Instance.new("Part",script)
  248. part17.Anchored = true
  249. part17.CFrame = owner.Character.Head.CFrame * CFrame.new(3.8,-1.7 + 1,1.65) * CFrame.Angles(math.rad(10),0,math.rad(-22.5))
  250. part17.Size = Vector3.new(0.65,2.5,1.125)
  251. part18 = Instance.new("Part",script)
  252. part18.Anchored = true
  253. part18.CFrame = owner.Character.Head.CFrame * CFrame.new(3.8,-1.7 + 1,-5.65) * CFrame.Angles(math.rad(-10),0,math.rad(-22.5))
  254. part18.Size = Vector3.new(0.65,2.5,1.125)
  255. part19 = Instance.new("Part",script)
  256. part19.Anchored = true
  257. part19.CFrame = owner.Character.Head.CFrame * CFrame.new(-2.75,-1.95 + 1,-2) * CFrame.Angles(0,0,math.rad(15))
  258. part19.Size = Vector3.new(0.65,2.125,8.125)
  259. part20 = Instance.new("Part",script)
  260. part20.Anchored = true
  261. part20.CFrame = owner.Character.Head.CFrame * CFrame.new(-3.125,-2.125 + 1,-2) * CFrame.Angles(0,0,math.rad(25))
  262. part20.Size = Vector3.new(0.35,1.85,8.65)
  263. part21 = Instance.new("Part",script)
  264. part21.Anchored = true
  265. part21.CFrame = owner.Character.Head.CFrame * CFrame.new(-4.65,-1.35 + 1,-2)
  266. part21.Size = Vector3.new(2.125,0.35,8.65)
  267. part22 = Instance.new("Part",script)
  268. part22.Anchored = true
  269. part22.CFrame = owner.Character.Head.CFrame * CFrame.new(-6.125,-2.125 + 1,-2) * CFrame.Angles(0,0,math.rad(-25))
  270. part22.Size = Vector3.new(0.35,1.85,8.65)
  271. part23 = Instance.new("Part",script)
  272. part23.Anchored = true
  273. part23.CFrame = owner.Character.Head.CFrame * CFrame.new(0.8,1.125 + 1,0.35) * CFrame.Angles(math.rad(-10),0,math.rad(35))
  274. part23.Size = Vector3.new(2,2.65,1.5)
  275. part24 = Instance.new("Part",script)
  276. part24.Anchored = true
  277. part24.CFrame = owner.Character.Head.CFrame * CFrame.new(0.8,1.125 + 1,-4.35) * CFrame.Angles(math.rad(10),0,math.rad(35))
  278. part24.Size = Vector3.new(2,2.65,1.5)
  279. part25 = Instance.new("Part",script)
  280. part25.Anchored = true
  281. part25.CFrame = owner.Character.Head.CFrame * CFrame.new(-3,1.125 + 1,0.65) * CFrame.Angles(math.rad(-10),0,0)
  282. part25.Size = Vector3.new(7,2.65,1)
  283. part26 = Instance.new("Part",script)
  284. part26.Anchored = true
  285. part26.CFrame = owner.Character.Head.CFrame * CFrame.new(-3,1.125 + 1,-4.65) * CFrame.Angles(math.rad(10),0,0)
  286. part26.Size = Vector3.new(7,2.65,1)
  287. part27 = Instance.new("Part",script)
  288. part27.Anchored = true
  289. part27.CFrame = owner.Character.Head.CFrame * CFrame.new(1.5,1.5 + 1,-2) * CFrame.Angles(0,0,math.rad(35))
  290. part27.Size = Vector3.new(1,2.65,5.5)
  291. part28 = Instance.new("Part",script)
  292. part28.Anchored = true
  293. part28.CFrame = owner.Character.Head.CFrame * CFrame.new(1.85,1.175 + 1,-2) * CFrame.Angles(0,0,math.rad(37.5))
  294. part28.Size = Vector3.new(1,1.5,3.75)
  295. part29 = Instance.new("Part",part)
  296. part29.CanCollide = false
  297. part29.Transparency = 0
  298. part32 = Instance.new("Part",script)
  299. part32.Anchored = true
  300. part32.CFrame = owner.Character.Head.CFrame * CFrame.new(-8,0.25,0.75)
  301. part32.Size = Vector3.new(0.455,1.035, 1.035)
  302. part32.Color = Color3.fromRGB(190, 104, 98)
  303. part32.Material = "Glass"
  304. part33 = Instance.new("Part",script)
  305. part33.Anchored = true
  306. part33.CFrame = owner.Character.Head.CFrame * CFrame.new(-8,0.25,-4.75)
  307. part33.Size = Vector3.new(0.455,1.035, 1.035)
  308. part33.Color = Color3.fromRGB(190, 104, 98)
  309. part33.Material = "Glass"
  310. part34 = Instance.new("Part",script)
  311. part34.Anchored = true
  312. part34.CFrame = owner.Character.Head.CFrame * CFrame.new(8,0.25,-4.75)
  313. part34.Size = Vector3.new(0.455,1.035, 1.035)
  314. part34.Shape = "Cylinder"
  315. part34.Material = "Glass"
  316. part35 = Instance.new("Part",script)
  317. part35.Anchored = true
  318. part35.CFrame = owner.Character.Head.CFrame * CFrame.new(8,0.25,0.75)
  319. part35.Shape = "Cylinder"
  320. part35.Size = Vector3.new(0.455,1.035, 1.035)
  321. part35.Material = "Glass"
  322. local hitdb = false
  323. wait()
  324. beam1 = Instance.new("Beam")
  325. beam1.Texture = "rbxassetid://175588117"
  326. beam1.TextureLength = 1
  327. beam1.LightEmission = 1
  328. beam1.CurveSize0 = 0
  329. beam1.CurveSize1 = 0
  330. beam1.FaceCamera = true
  331. beam1.Segments = 2
  332. beam1.Width0 = 1
  333. beam1.Width1 = 8
  334. beam1.Enabled = false
  335. beam1.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)}
  336. local bat1 = Instance.new("Attachment",part)
  337. bat1.WorldCFrame = part34.CFrame
  338. local bat2 = Instance.new("Attachment",part34)
  339. bat2.WorldCFrame = part34.CFrame * CFrame.new(24,0,0)
  340. beam1.Attachment0 = bat1
  341. beam1.Attachment1 = bat2
  342. beam1.Parent = part
  343. local lon = false
  344. function lights(on)
  345. if on then
  346. part33.Color = Color3.fromRGB(190, 104, 98)
  347. part33.Material = "Neon"
  348. part32.Color = Color3.fromRGB(190, 104, 98)
  349. part32.Material = "Neon"
  350. else
  351. part33.Color = Color3.fromRGB(190, 104, 98)
  352. part33.Material = "Glass"
  353. part32.Color = Color3.fromRGB(190, 104, 98)
  354. part32.Material = "Glass"
  355. end
  356. end
  357. wait()
  358. beam2 = Instance.new("Beam",part)
  359. beam2.Texture = "rbxassetid://175588117"
  360. beam2.TextureLength = 1
  361. beam2.LightEmission = 1
  362. beam2.CurveSize0 = 0
  363. beam2.CurveSize1 = 0
  364. beam2.FaceCamera = true
  365. beam2.Segments = 2
  366. beam2.Width0 = 1
  367. beam2.Width1 = 8
  368. beam2.Enabled = false
  369. beam2.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)}
  370. local bat3 = Instance.new("Attachment",part)
  371. bat3.WorldCFrame = part35.CFrame
  372. local bat4 = Instance.new("Attachment",part35)
  373. bat4.WorldCFrame = part35.CFrame * CFrame.new(24,0,0)
  374. beam2.Attachment0 = bat3
  375. beam2.Attachment1 = bat4
  376. lat = Instance.new("Attachment",part)
  377. lat.CFrame = CFrame.new(0,1,-8)
  378. light = Instance.new("SpotLight",lat)
  379. light.Enabled = false
  380. light.Range = 24
  381. light.Face = "Front"
  382. light.Color = Color3.fromRGB(255,255,255)
  383. light.Brightness = 3
  384. light.Angle = 85
  385. function headlights()
  386. beam1.Enabled = not beam1.Enabled
  387. beam2.Enabled = not beam2.Enabled
  388. light.Enabled = not light.Enabled
  389. if not lon then
  390. lon = true
  391. part34.Color = Color3.fromRGB(232, 232, 232)
  392. part34.Material = "Neon"
  393. part35.Color = Color3.fromRGB(232, 232, 232)
  394. part35.Material = "Neon"
  395. else
  396. lon = false
  397. part34.BrickColor = BrickColor.new("Medium Stone Grey")
  398. part34.Material = "Glass"
  399. part35.BrickColor = BrickColor.new("Medium Stone Grey")
  400. part35.Material = "Glass"
  401. end
  402. end
  403. local part2 = Instance.new("Part",part)
  404. part2.CFrame = owner.Character.Head.CFrame
  405. part2.CanCollide = false
  406. local part3 = Instance.new("Part",part)
  407. part3.CFrame = owner.Character.Head.CFrame
  408. part3.CanCollide = false
  409. local ats = Instance.new("Attachment",part29)
  410. ats.CFrame = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(90),0)
  411. local ats2 = Instance.new("Attachment",part2)
  412. ats2.CFrame = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  413. local steer = Instance.new("HingeConstraint",part29)
  414. steer.LimitsEnabled = true
  415. steer.LowerAngle = -20
  416. steer.UpperAngle = 20
  417. steer.Attachment0 = ats
  418. steer.Attachment1 = ats2
  419. local ats3 = Instance.new("Attachment",part)
  420. ats3.CFrame = CFrame.new(0,0,4.65) * CFrame.Angles(0,math.rad(90),0)
  421. local ats4 = Instance.new("Attachment",part3)
  422. ats4.CFrame = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(90),0)
  423. local steer2 = Instance.new("HingeConstraint",part)
  424. steer2.LimitsEnabled = true
  425. steer2.LowerAngle = -20
  426. steer2.UpperAngle = 20
  427. steer2.Attachment0 = ats3
  428. steer2.Attachment1 = ats4
  429. local steer = Instance.new("BallSocketConstraint",part)
  430. steer.Attachment0 = ats
  431. steer.Attachment1 = ats2
  432. steer.MaxFrictionTorque = 500
  433. local ats = Instance.new("Attachment",part)
  434. ats.CFrame = CFrame.new(0,0,-5.65) * CFrame.Angles(0,math.rad(0),math.rad(90))
  435. local ats2 = Instance.new("Attachment",part29)
  436. ats2.CFrame = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),math.rad(90))
  437. part29.CFrame = part.CFrame * ats.CFrame
  438. part2.CFrame = part.CFrame * ats.CFrame
  439. steer = Instance.new("HingeConstraint")
  440. steer.Parent = part
  441. steer.ActuatorType = "Servo"
  442. steer.TargetAngle = 0
  443. steer.ServoMaxTorque = 10000000000000000
  444. steer.AngularSpeed = 100000000000000
  445. steer.Attachment0 = ats
  446. steer.Attachment1 = ats2
  447. local off = true
  448. owner.Character.Head.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,2)
  449. local mesh = Instance.new("SpecialMesh",part31)
  450. mesh.Scale = Vector3.new(0.35,0.35,0.35)
  451. mesh.MeshId = "rbxassetid://3651987136"
  452. mesh.TextureId = "rbxassetid://3710187949"
  453. mesh.Offset = Vector3.new(0,1,0)
  454. for i,v in pairs(script:GetChildren()) do
  455. if v ~= part then
  456. local wel = Instance.new("WeldConstraint",part)
  457. wel.Part0 = v
  458. wel.Part1 = part
  459. v.Anchored = false
  460. v.Transparency = 1
  461. end
  462. end
  463. for i,v in pairs(script:GetDescendants()) do
  464. if v:IsA("Part") then
  465. PhysicsService:SetPartCollisionGroup(v, car)
  466. v.Locked = true
  467. local density = 3
  468. local friction = 1
  469. local elasticity = 0
  470. local frictionWeight = 10000
  471. local elasticityWeight = 100000
  472. local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
  473. v.CustomPhysicalProperties = physProperties
  474. end
  475. end
  476. wait()
  477. local t = Instance.new("Torque",part)
  478. local ats = Instance.new("Attachment",part)
  479. t.Attachment0 = ats
  480. t.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
  481. t.Torque = Vector3.new()
  482. part.Transparency = 1
  483. part.Locked = true
  484. part31.Material = "Plastic"
  485. a2.Transparency = 0
  486. a3.Transparency = 0
  487. part.CanCollide = false
  488. part31.Transparency = 0
  489. part33.Transparency = 0
  490. part32.Transparency = 0
  491. part34.Transparency = 0
  492. part35.Transparency = 0
  493. part29.Transparency = 1
  494. PhysicsService:SetPartCollisionGroup(part, car)
  495. local mass = 0
  496. for i,v in pairs(script:GetDescendants()) do
  497. pcall(function()
  498. mass += v:GetMass()
  499. end)
  500. end
  501. part2.CanCollide = false
  502. part3.CanCollide = false
  503. part29.CanCollide = false
  504. part2.Transparency = 1
  505. part3.Transparency = 1
  506. part29.Transparency = 1
  507. local mot1 = suspension(part2,CFrame.new(-2.5,0.5,0) * CFrame.Angles(0,math.rad(0),0),false,"Back",mass)
  508. local mot2 = suspension(part3,CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,math.rad(0),0),true,"Back",mass)
  509. local mot3 = suspension(part2,CFrame.new(-2.5,0.5,0) * CFrame.Angles(0,math.rad(180),0),false,"Front",mass)
  510. local mot4 = suspension(part3,CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,math.rad(180),0),true,"Front",mass)
  511. mot1.AngularVelocity = 0
  512. mot2.AngularVelocity = 0
  513. mot3.AngularVelocity = 0
  514. mot4.AngularVelocity = 0
  515. wait(0.25)
  516. PhysicsService:CollisionGroupSetCollidable(car, wheels, false)
  517. wait(0.1)
  518. part.Anchored = false
  519. local speed = 0
  520. local throt = false
  521. local mod = nil
  522. prox = Instance.new("ProximityPrompt",part)
  523. prox.RequiresLineOfSight = false
  524. prox.Style = Enum.ProximityPromptStyle.Custom
  525. prox2 = Instance.new("ProximityPrompt",part)
  526. prox2.RequiresLineOfSight = false
  527. prox2.Style = Enum.ProximityPromptStyle.Custom
  528. prox2.KeyboardKeyCode = Enum.KeyCode.H
  529. prox.Triggered:Connect(function(player)
  530. if player.Character == mod then
  531. headlights()
  532. end
  533. end)
  534. prox3 = Instance.new("ProximityPrompt",part)
  535. prox3.RequiresLineOfSight = false
  536. prox3.Style = Enum.ProximityPromptStyle.Custom
  537. prox3.KeyboardKeyCode = Enum.KeyCode.G
  538. local starting = false
  539. prox3.Triggered:Connect(function(player)
  540. if player.Character == mod then
  541. if off and not starting then
  542. start.Volume = 2
  543. start.SoundId = "rbxassetid://9075587875"
  544. starting = true
  545. start:Play()
  546. tween:Play()
  547. tween.Completed:Wait()
  548. off = false
  549. starting = false
  550. elseif not off and not starting then
  551. start.Volume = 3
  552. start.SoundId = "rbxassetid://4655463946"
  553. off = true
  554. start:Play()
  555. end
  556. end
  557. end)
  558. honking = false
  559. music = Instance.new("Sound",part)
  560. music.Pitch = 0
  561. music.Volume = 0.65
  562. local musics = {"1838857104","1835495895","9047888542","1835495943","9047908120"}
  563. music.SoundId = "rbxassetid://" .. musics[math.random(1, #musics)]
  564.  
  565. music.Ended:Connect(function(SoundId)
  566. local newSoundId
  567.  
  568. do repeat
  569. newSoundId = "rbxassetid://" .. musics[math.random(1, #musics)]
  570. wait()
  571. until
  572. newSoundId ~= SoundId
  573. end
  574.  
  575. music:Stop()
  576. music.SoundId = newSoundId
  577. music.TimePosition = 0
  578. task.wait()
  579. music:Play()
  580. end)
  581. music:Play()
  582. local honks = Instance.new("Sound",part)
  583. honks.SoundId = "rbxassetid://7817329753"
  584. honks.Looped = true
  585. honks.Volume = 0
  586. function honk(what)
  587. if what == true then
  588. honks:Play()
  589. honking = true
  590. coroutine.wrap(function()
  591. for i = 1,3 do
  592. if not honking then break end
  593. wait(0.00125)
  594. honks.Volume = math.clamp(honks.Volume + 0.666666666667,0,2)
  595. end
  596. end)()
  597. elseif what == false then
  598. honking = false
  599. for i = 1,3 do
  600. if honking then break end
  601. wait(0.00125)
  602. honks.Volume = math.clamp(honks.Volume - 0.666666666667,0,2)
  603. end
  604. honks:Stop()
  605. end
  606. end
  607. prox2.Triggered:Connect(function(player)
  608. if player.Character == mod then
  609. honk(true)
  610. end
  611. end)
  612. prox2.TriggerEnded:Connect(function(player)
  613. if player.Character == mod then
  614. honk(false)
  615. end
  616. end)
  617. part:GetPropertyChangedSignal("Occupant"):Connect(function()
  618. if part.Occupant ~= nil then
  619. local Model = part.Occupant:FindFirstAncestorOfClass("Model")
  620. if Model then
  621. mod = Model
  622. else
  623. mod = nil
  624. end
  625. else
  626. task.wait()
  627. mod.PrimaryPart.CFrame = mod.PrimaryPart.CFrame * CFrame.new(8,0,0)
  628. mod = nil
  629. end
  630. end)
  631. local mod2 = nil
  632. local mod3 = nil
  633. part36:GetPropertyChangedSignal("Occupant"):Connect(function()
  634. if part36.Occupant ~= nil then
  635. local Model = part36.Occupant:FindFirstAncestorOfClass("Model")
  636. if Model then
  637. mod2 = Model
  638. else
  639. mod2 = nil
  640. end
  641. else
  642. task.wait()
  643. mod2.PrimaryPart.CFrame = mod2.PrimaryPart.CFrame * CFrame.new(0,0,4)
  644. mod2 = nil
  645. end
  646. end)
  647. part37:GetPropertyChangedSignal("Occupant"):Connect(function()
  648. if part37.Occupant ~= nil then
  649. local Model = part37.Occupant:FindFirstAncestorOfClass("Model")
  650. if Model then
  651. mod3 = Model
  652. else
  653. mod3 = nil
  654. end
  655. else
  656. task.wait()
  657. mod3.PrimaryPart.CFrame = mod3.PrimaryPart.CFrame * CFrame.new(0,0,4)
  658. mod3 = nil
  659. end
  660. end)
  661. local currentthrot = 0
  662. local function carMove(property)
  663. if property == "ThrottleFloat" then
  664. if part.ThrottleFloat ~= 0 then
  665. currentthrot = part.ThrottleFloat
  666. throt = true
  667. else
  668. currentthrot = 0
  669. throt = false
  670. end
  671. end
  672. end
  673. lastthrot = 0
  674.  
  675. part.Changed:Connect(carMove)
  676. coroutine.wrap(function()
  677. while task.wait() do
  678. if not off then
  679. steer.TargetAngle = 27.5 * -part.SteerFloat
  680. sound.Pitch = math.clamp(speed * 0.0425,0,1.1125)
  681. sound.PlaybackSpeed = math.clamp(speed * 0.0425,0,1.1125)
  682. sound.Volume = math.clamp(sound.Volume + 0.1,0,1.5)
  683. music.Pitch = math.clamp(music.Pitch + 0.05,0,1)
  684. idle.Volume = math.clamp(idle.Volume + 0.01,0,0.25)
  685. else
  686. steer.TargetAngle = 0
  687. sound.Pitch = math.clamp(sound.Pitch - 0.025,0,1.1125)
  688. sound.PlaybackSpeed = math.clamp(sound.PlaybackSpeed - 0.025,0,1.1125)
  689. sound.Volume = math.clamp(sound.Volume - 0.025,0,1.5)
  690. idle.Volume = math.clamp(idle.Volume - 0.005,0,0.25)
  691. music.Pitch = math.clamp(music.Pitch - 0.01,0,1)
  692. end
  693. end
  694. end)()
  695. local reverse = false
  696. while task.wait() do
  697. if throt and math.clamp(currentthrot * 500,-1,1) ~= -lastthrot and not off then
  698. lastthrot = part.Throttle
  699. lights(false)
  700. wait(0.0525)
  701. speed = math.clamp(speed + 0.75,0,35)
  702. mot1.AngularVelocity = part.ThrottleFloat * speed
  703. mot2.AngularVelocity = part.ThrottleFloat * speed
  704. mot3.AngularVelocity = -part.ThrottleFloat * speed
  705. mot4.AngularVelocity = -part.ThrottleFloat * speed
  706. elseif throt and math.clamp(currentthrot * 500,-1,1) == -lastthrot and not off then
  707. lights(true)
  708. for i = 1, 35 do
  709. wait(0.0525)
  710. speed = math.clamp(speed - 1,0,35)
  711. mot1.AngularVelocity = lastthrot * speed
  712. mot2.AngularVelocity = lastthrot * speed
  713. mot3.AngularVelocity = -lastthrot * speed
  714. mot4.AngularVelocity = -lastthrot * speed
  715. if speed == 0 then
  716. lastthrot = part.Throttle
  717. if speed == 0 then break end
  718. end
  719. end
  720. elseif not throt or off then
  721. if speed ~= 0 then
  722. lights(true)
  723. wait(0.0325)
  724. else
  725. lights(false)
  726. end
  727. speed = math.clamp(speed - 0.75,0,35)
  728. mot1.AngularVelocity = lastthrot * speed
  729. mot2.AngularVelocity = lastthrot * speed
  730. mot3.AngularVelocity = -lastthrot * speed
  731. mot4.AngularVelocity = -lastthrot * speed
  732. end
  733. end
Add Comment
Please, Sign In to add comment