TheUnknownDiscord

suspension car

Oct 28th, 2021 (edited)
184
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. seat = Instance.new("VehicleSeat", script)
  2. seat.Size = Vector3.new(3,1,7.5)
  3. seat.CFrame = CFrame.new(10,10,10)
  4. seat.Anchored = true
  5. seat2 = Instance.new("Seat", script)
  6. seat2.Size = Vector3.new(1.5,1,3)
  7. seat2.CFrame = CFrame.new(10,10,13.5)
  8. seat3 = Instance.new("Seat", script)
  9. seat3.Size = Vector3.new(1.5,1,3)
  10. seat3.CFrame = CFrame.new(10,10,13.5)
  11. wheel = Instance.new("Part")
  12. wheel.Parent = seat
  13. wheel.Size = Vector3.new(2,4,4)
  14. wheel.TopSurface = Enum.SurfaceType.Smooth
  15. wheel.BottomSurface = Enum.SurfaceType.Smooth
  16. wheel2 = Instance.new("Part")
  17. wheel2.Parent = seat
  18. wheel2.Size = Vector3.new(2,4,4)
  19. wheel2.TopSurface = Enum.SurfaceType.Smooth
  20. wheel2.BottomSurface = Enum.SurfaceType.Smooth
  21. wheel3 = Instance.new("Part")
  22. wheel3.Parent = seat
  23. wheel3.Size = Vector3.new(2,4,4)
  24. wheel3.TopSurface = Enum.SurfaceType.Smooth
  25. wheel3.BottomSurface = Enum.SurfaceType.Smooth
  26. wheel4 = Instance.new("Part")
  27. wheel4.Parent = seat
  28. wheel4.Size = Vector3.new(2,4,4)
  29. wheel4.TopSurface = Enum.SurfaceType.Smooth
  30. wheel4.BottomSurface = Enum.SurfaceType.Smooth
  31. wheel.Shape = Enum.PartType.Cylinder
  32. wheel2.Shape = Enum.PartType.Cylinder
  33. wheel3.Shape = Enum.PartType.Cylinder
  34. wheel4.Shape = Enum.PartType.Cylinder
  35. local a = Instance.new("Part", seat)
  36. local a2 = Instance.new("Part", seat)
  37. a.Transparency = 1
  38. a2.Transparency = 1
  39. a.Size = Vector3.new(1,1,1)
  40. a2.Size = Vector3.new(1,1,1)
  41. local at0 = Instance.new("Attachment" , a)
  42. at0.CFrame = CFrame.Angles(0,0,math.rad(-90))
  43. local at1 = Instance.new("Attachment" , a2)
  44. at1.CFrame = CFrame.Angles(0,0,math.rad(-90))
  45. local spring = Instance.new("SpringConstraint" , a)
  46. spring.Attachment0 = at0
  47. spring.Attachment1 = at1
  48. spring.Stiffness = 30000
  49. spring.FreeLength = 2
  50. spring.Enabled = true
  51. spring.Visible = false
  52. spring.Damping = 400
  53. local prism = Instance.new("PrismaticConstraint" , a)
  54. prism.Attachment0 = at0
  55. prism.Attachment1 = at1
  56. prism.LimitsEnabled = true
  57. prism.LowerLimit = -4
  58. prism.UpperLimit = 2
  59. local a3 = Instance.new("Part", seat)
  60. local a4 = Instance.new("Part", seat)
  61. a3.Transparency = 1
  62. a4.Transparency = 1
  63. a3.Size = Vector3.new(1,1,1)
  64. a4.Size = Vector3.new(1,1,1)
  65. local at2 = Instance.new("Attachment" , a3)
  66. at2.CFrame = CFrame.Angles(0,0,math.rad(-90))
  67. local at3 = Instance.new("Attachment" , a4)
  68. at3.CFrame = CFrame.Angles(0,0,math.rad(-90))
  69. local spring2 = Instance.new("SpringConstraint" , a3)
  70. spring2.Attachment0 = at2
  71. spring2.Attachment1 = at3
  72. spring2.Stiffness = 30000
  73. spring2.FreeLength = 2
  74. spring2.Enabled = true
  75. spring2.Visible = false
  76. spring2.Damping = 400
  77. local prism2 = Instance.new("PrismaticConstraint" , a3)
  78. prism2.Attachment0 = at2
  79. prism2.Attachment1 = at3
  80. prism2.LimitsEnabled = true
  81. prism2.LowerLimit = -4
  82. prism2.UpperLimit = 2
  83. local a5 = Instance.new("Part", seat)
  84. local a6 = Instance.new("Part", seat)
  85. a5.Transparency = 1
  86. a6.Transparency = 1
  87. a5.Size = Vector3.new(1,1,1)
  88. a6.Size = Vector3.new(1,1,1)
  89. local blockweld3 = Instance.new("Weld", seat)
  90. blockweld3.Part0 = a5
  91. blockweld3.Part1 = seat
  92. blockweld3.C0 = CFrame.new(-3.5, -2, -5.75)
  93. local blockweld = Instance.new("Weld", seat)
  94. blockweld.Part0 = seat2
  95. blockweld.Part1 = seat
  96. blockweld.C0 = CFrame.new(-0.75,0,-4)
  97. local blockweld2 = Instance.new("Weld", seat)
  98. blockweld2.Part0 = seat3
  99. blockweld2.Part1 = seat
  100. blockweld2.C0 = CFrame.new(0.75,0,-4)
  101. local at4 = Instance.new("Attachment" , a5)
  102. at4.CFrame = CFrame.Angles(0,0,math.rad(-90))
  103. local at5 = Instance.new("Attachment" , a6)
  104. at5.CFrame = CFrame.Angles(0,0,math.rad(-90))
  105. local spring3 = Instance.new("SpringConstraint" , a5)
  106. spring3.Attachment0 = at4
  107. spring3.Attachment1 = at5
  108. spring3.Stiffness = 30000
  109. spring3.FreeLength = 2
  110. spring3.Enabled = true
  111. spring3.Visible = false
  112. spring3.Damping = 400
  113. local prism3 = Instance.new("PrismaticConstraint" , a5)
  114. prism3.Attachment0 = at4
  115. prism3.Attachment1 = at5
  116. prism3.LimitsEnabled = true
  117. prism3.LowerLimit = -4
  118. prism3.UpperLimit = 2
  119. local a7 = Instance.new("Part", seat)
  120. local a8 = Instance.new("Part", seat)
  121. a7.Transparency = 1
  122. a8.Transparency = 1
  123. a7.Size = Vector3.new(1,1,1)
  124. a8.Size = Vector3.new(1,1,1)
  125. local blockweld4 = Instance.new("Weld", seat)
  126. blockweld4.Part0 = a7
  127. blockweld4.Part1 = seat
  128. blockweld4.C0 = CFrame.new(3.5, -2, -5.75)
  129. local at6 = Instance.new("Attachment" , a7)
  130. at6.CFrame = CFrame.Angles(0,0,math.rad(-90))
  131. local at7 = Instance.new("Attachment" , a8)
  132. at7.CFrame = CFrame.Angles(0,0,math.rad(-90))
  133. local spring4 = Instance.new("SpringConstraint" , a7)
  134. spring4.Attachment0 = at6
  135. spring4.Attachment1 = at7
  136. spring4.Stiffness = 30000
  137. spring4.FreeLength = 2
  138. spring4.Enabled = true
  139. spring4.Visible = false
  140. spring4.Damping = 400
  141. local prism4 = Instance.new("PrismaticConstraint" , a7)
  142. prism4.Attachment0 = at6
  143. prism4.Attachment1 = at7
  144. prism4.LimitsEnabled = true
  145. prism4.LowerLimit = -4
  146. prism4.UpperLimit = 2
  147. local attachment031 = Instance.new("Attachment")
  148. attachment031.Parent = wheel
  149. local attachment131 = Instance.new("Attachment")
  150. attachment131.Parent = a2
  151. alignposition31 = Instance.new("HingeConstraint")
  152. alignposition31.Parent = a2
  153. alignposition31.ActuatorType = Enum.ActuatorType.None
  154. alignposition31.Attachment0 = attachment031
  155. alignposition31.Attachment1 = attachment131
  156. attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(0,0,0)
  157. wheel.CFrame = a2.CFrame
  158. local attachment0231 = Instance.new("Attachment")
  159. attachment0231.Parent = wheel2
  160. local attachment1231 = Instance.new("Attachment")
  161. attachment1231.Parent = a4
  162. alignposition231 = Instance.new("HingeConstraint")
  163. alignposition231.Parent = a4
  164. alignposition231.ActuatorType = Enum.ActuatorType.None
  165. alignposition231.Attachment0 = attachment0231
  166. alignposition231.Attachment1 = attachment1231
  167. attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(0,0,0)
  168. wheel2.CFrame = a4.CFrame
  169. local attachment03 = Instance.new("Attachment")
  170. attachment03.Parent = wheel3
  171. local attachment13 = Instance.new("Attachment")
  172. attachment13.Parent = a6
  173. alignposition3 = Instance.new("HingeConstraint")
  174. alignposition3.Parent = a6
  175. alignposition3.ActuatorType = "Motor"
  176. alignposition3.MotorMaxAcceleration = 10000000
  177. alignposition3.MotorMaxTorque = 10000000
  178. alignposition3.Name = "Hinge1"
  179. alignposition3.Attachment0 = attachment03
  180. alignposition3.Attachment1 = attachment13
  181. attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(0,0,0)
  182. wheel3.CFrame = a6.CFrame
  183. local attachment023 = Instance.new("Attachment")
  184. attachment023.Parent = wheel4
  185. local attachment123 = Instance.new("Attachment")
  186. attachment123.Parent = a8
  187. alignposition23 = Instance.new("HingeConstraint")
  188. alignposition23.Parent = a8
  189. alignposition23.ActuatorType = "Motor"
  190. alignposition23.MotorMaxAcceleration = 10000000
  191. alignposition23.MotorMaxTorque = 10000000
  192. alignposition23.Name = "Hinge2"
  193. alignposition23.Attachment0 = attachment023
  194. alignposition23.Attachment1 = attachment123
  195. wheel4.CFrame = a8.CFrame
  196. attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(0,0,0)
  197. local attachmentlol = Instance.new("Attachment")
  198. attachmentlol.Parent = seat
  199. attachmentlol.WorldCFrame = attachmentlol.Parent.CFrame * CFrame.new(3.5, 2, -3.75) * CFrame.Angles(0,0,math.rad(-90))
  200. local attachmentlol2 = Instance.new("Attachment")
  201. attachmentlol2.Parent = seat
  202. attachmentlol2.WorldCFrame = attachmentlol2.Parent.CFrame * CFrame.new(-3.5, 2, -3.75) * CFrame.Angles(0,0,math.rad(-90))
  203. alignposition = Instance.new("HingeConstraint")
  204. alignposition.Parent = seat
  205. alignposition.ActuatorType = "Servo"
  206. alignposition.TargetAngle = 0
  207. alignposition.Name = "Hinge4"
  208. alignposition.ServoMaxTorque = 100000000000
  209. alignposition.AngularSpeed = 10000000
  210. alignposition.Attachment0 = attachmentlol
  211. alignposition.Attachment1 = at0
  212. alignposition2 = Instance.new("HingeConstraint")
  213. alignposition2.Parent = seat
  214. alignposition2.ActuatorType = "Servo"
  215. alignposition2.TargetAngle = 0
  216. alignposition2.Name = "Hinge4"
  217. alignposition2.ServoMaxTorque = 100000000000
  218. alignposition2.AngularSpeed = 10000000
  219. alignposition2.Attachment0 = attachmentlol2
  220. alignposition2.Attachment1 = at2
  221. a.CanCollide = false
  222. a2.CanCollide = false
  223. a3.CanCollide = false
  224. a4.CanCollide = false
  225. a5.CanCollide = false
  226. a6.CanCollide = false
  227. a7.CanCollide = false
  228. a8.CanCollide = false
  229. Mesh = Instance.new("SpecialMesh")
  230. Mesh.Parent = wheel
  231. Mesh.MeshId = "http://www.roblox.com/asset/?id=5738250964"
  232. Mesh.TextureId = "http://www.roblox.com/asset/?id=5738250999"
  233. Mesh2 = Instance.new("SpecialMesh")
  234. Mesh2.Parent = wheel2
  235. Mesh2.MeshId = "http://www.roblox.com/asset/?id=5738250964"
  236. Mesh2.TextureId = "http://www.roblox.com/asset/?id=5738250999"
  237. Mesh3 = Instance.new("SpecialMesh")
  238. Mesh3.Parent = wheel3
  239. Mesh3.MeshId = "http://www.roblox.com/asset/?id=5738250964"
  240. Mesh3.TextureId = "http://www.roblox.com/asset/?id=5738250999"
  241. Mesh4 = Instance.new("SpecialMesh")
  242. Mesh4.Parent = wheel4
  243. Mesh4.MeshId = "http://www.roblox.com/asset/?id=5738250964"
  244. Mesh4.TextureId = "http://www.roblox.com/asset/?id=5738250999"
  245. speed = 20
  246. on = false
  247. local function carMove(property)
  248. if property == "Throttle" then
  249. alignposition23.AngularVelocity = seat.Throttle * speed
  250. alignposition3.AngularVelocity = seat.Throttle * speed
  251. elseif property == "Steer" then
  252. alignposition.TargetAngle = 27.5 * seat.Steer
  253. alignposition2.TargetAngle = 27.5 * seat.Steer
  254. end
  255. end
  256. seat.Changed:Connect(carMove)
  257. wait(0.1)
  258. seat:Sit(owner.Character.Humanoid)
  259. local density = 1
  260. local friction = 5
  261. local elasticity = 0
  262. local frictionWeight = 100000000000
  263. local elasticityWeight = 0
  264. local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
  265. wheel.CustomPhysicalProperties = physProperties
  266. wheel2.CustomPhysicalProperties = physProperties
  267. wheel3.CustomPhysicalProperties = physProperties
  268. wheel4.CustomPhysicalProperties = physProperties
  269. wait(1.5)
  270. seat.Anchored = false
RAW Paste Data