TheUnknownDiscord

car remake

Oct 13th, 2021 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.38 KB | None | 0 0
  1. Seat = Instance.new("VehicleSeat")
  2. Seat.Parent = owner.Character
  3. Seat.Size = Vector3.new(4,1,10)
  4. Seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,8,-8.057)
  5. Seat.TopSurface = Enum.SurfaceType.Smooth
  6. Seat.BottomSurface = Enum.SurfaceType.Smooth
  7. Bumper = Instance.new("Part")
  8. Bumper.Parent = owner.Character
  9. Bumper.Size = Vector3.new(7.75,2.25,2.75)
  10. Weldlol3 = Instance.new("Weld")
  11. Weldlol3.Parent = Seat
  12. Weldlol3.Part0 = Seat
  13. Weldlol3.Part1 = Bumper
  14. Weldlol3.C1 = Weldlol3.C1 * CFrame.new(0,-1.25,11)
  15. Bumper2 = Instance.new("Part")
  16. Bumper2.Parent = owner.Character
  17. Bumper2.Size = Vector3.new(7.75,2.25,2.5)
  18. Weldlol31 = Instance.new("Weld")
  19. Weldlol31.Parent = Seat
  20. Weldlol31.Part0 = Seat
  21. Weldlol31.Part1 = Bumper2
  22. Weldlol31.C1 = Weldlol31.C1 * CFrame.new(0,-1.25,-11)
  23. Bumper.Transparency = 1
  24. Bumper2.Transparency = 1
  25. Mesh = Instance.new("SpecialMesh")
  26. Mesh.Parent = Seat
  27. Mesh.MeshId = "http://www.roblox.com/asset/?id=439129429"
  28. Mesh.TextureId = "http://www.roblox.com/asset/?id=439125379"
  29. Mesh.Scale = Vector3.new(0.045, 0.045, 0.045)
  30. Mesh.Offset = Vector3.new(0, 2.5, 0)
  31. wheel = Instance.new("Part")
  32. wheel.Parent = Seat
  33. wheel.Size = Vector3.new(1,3,3)
  34. steer = Instance.new("Part")
  35. steer.Parent = Seat
  36. steer.Size = Vector3.new(1,1,1)
  37. steer2 = Instance.new("Part")
  38. steer2.Parent = Seat
  39. steer2.Size = Vector3.new(1,1,1)
  40. steer.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25)
  41. steer2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,1,-7.25)
  42. steer.Transparency = 1
  43. steer.CanCollide = false
  44. steer2.Transparency = 1
  45. steer2.CanCollide = false
  46. Seat.Anchored = true
  47. wheel.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,-7.25)
  48. wheel.TopSurface = Enum.SurfaceType.Smooth
  49. wheel.BottomSurface = Enum.SurfaceType.Smooth
  50. wheel2 = Instance.new("Part")
  51. wheel2.Parent = Seat
  52. wheel2.Size = Vector3.new(1,3,3)
  53. wheel2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25)
  54. wheel2.TopSurface = Enum.SurfaceType.Smooth
  55. wheel2.BottomSurface = Enum.SurfaceType.Smooth
  56. wheel3 = Instance.new("Part")
  57. wheel3.Parent = Seat
  58. wheel3.Size = Vector3.new(1,3,3)
  59. wheel3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,5.75)
  60. wheel3.TopSurface = Enum.SurfaceType.Smooth
  61. wheel3.BottomSurface = Enum.SurfaceType.Smooth
  62. wheel4 = Instance.new("Part")
  63. wheel4.Parent = Seat
  64. wheel4.Size = Vector3.new(1,3,3)
  65. wheel4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,5.75)
  66. wheel4.TopSurface = Enum.SurfaceType.Smooth
  67. wheel4.BottomSurface = Enum.SurfaceType.Smooth
  68. wheel.Shape = Enum.PartType.Cylinder
  69. wheel2.Shape = Enum.PartType.Cylinder
  70. wheel3.Shape = Enum.PartType.Cylinder
  71. wheel4.Shape = Enum.PartType.Cylinder
  72. local attachment0 = Instance.new("Attachment")
  73. attachment0.Parent = steer
  74. local attachment1 = Instance.new("Attachment")
  75. attachment1.Parent = Seat
  76. alignposition = Instance.new("HingeConstraint")
  77. alignposition.Parent = Seat
  78. alignposition.ActuatorType = "Servo"
  79. alignposition.TargetAngle = 0
  80. alignposition.Name = "Hinge4"
  81. alignposition.ServoMaxTorque = 10000000
  82. alignposition.AngularSpeed = 10000000
  83. alignposition.Attachment0 = attachment0
  84. alignposition.Attachment1 = attachment1
  85. attachment1.WorldCFrame = attachment1.Parent.CFrame * CFrame.new(-3.739,1,-7.25) * CFrame.Angles(0,math.rad(180),math.rad(90))
  86. local attachment02 = Instance.new("Attachment")
  87. attachment02.Parent = steer2
  88. local attachment12 = Instance.new("Attachment")
  89. attachment12.Parent = Seat
  90. alignposition2 = Instance.new("HingeConstraint")
  91. alignposition2.Parent = Seat
  92. alignposition2.ActuatorType = "Servo"
  93. alignposition2.TargetAngle = 0
  94. alignposition2.Name = "Hinge3"
  95. alignposition2.ServoMaxTorque = 10000000
  96. alignposition2.AngularSpeed = 10000000
  97. alignposition2.Attachment0 = attachment02
  98. alignposition2.Attachment1 = attachment12
  99. attachment12.WorldCFrame = attachment12.Parent.CFrame * CFrame.new(3.739,1,-7.25) * CFrame.Angles(0,0,math.rad(90))
  100. task.wait()
  101. local attachment031 = Instance.new("Attachment")
  102. attachment031.Parent = wheel
  103. local attachment131 = Instance.new("Attachment")
  104. attachment131.Parent = steer
  105. alignposition31 = Instance.new("HingeConstraint")
  106. alignposition31.Parent = Seat
  107. alignposition31.ActuatorType = Enum.ActuatorType.None
  108. alignposition31.Attachment0 = attachment031
  109. alignposition31.Attachment1 = attachment131
  110. attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
  111. local attachment0231 = Instance.new("Attachment")
  112. attachment0231.Parent = wheel2
  113. local attachment1231 = Instance.new("Attachment")
  114. attachment1231.Parent = steer2
  115. alignposition231 = Instance.new("HingeConstraint")
  116. alignposition231.Parent = Seat
  117. alignposition231.ActuatorType = Enum.ActuatorType.None
  118. alignposition231.Attachment0 = attachment0231
  119. alignposition231.Attachment1 = attachment1231
  120. attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
  121. local attachment03 = Instance.new("Attachment")
  122. attachment03.Parent = wheel3
  123. local attachment13 = Instance.new("Attachment")
  124. attachment13.Parent = Seat
  125. alignposition3 = Instance.new("HingeConstraint")
  126. alignposition3.Parent = Seat
  127. alignposition3.ActuatorType = "Motor"
  128. alignposition3.MotorMaxAcceleration = 10000000
  129. alignposition3.MotorMaxTorque = 10000000
  130. alignposition3.Name = "Hinge1"
  131. alignposition3.Attachment0 = attachment03
  132. alignposition3.Attachment1 = attachment13
  133. attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,0,5.75)* CFrame.Angles(0,math.rad(180),0)
  134. local attachment023 = Instance.new("Attachment")
  135. attachment023.Parent = wheel4
  136. local attachment123 = Instance.new("Attachment")
  137. attachment123.Parent = Seat
  138. alignposition23 = Instance.new("HingeConstraint")
  139. alignposition23.Parent = Seat
  140. alignposition23.ActuatorType = "Motor"
  141. alignposition23.MotorMaxAcceleration = 10000000
  142. alignposition23.MotorMaxTorque = 10000000
  143. alignposition23.Name = "Hinge2"
  144. alignposition23.Attachment0 = attachment023
  145. alignposition23.Attachment1 = attachment123
  146. attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,0,5.75)
  147. local motor1 = alignposition3
  148. local motor2 = alignposition23
  149. local steerServo = alignposition
  150. local steerServo2 = alignposition2
  151. local maxSpeed = 42.5
  152. local angleSteer = 27.5
  153. local function carMove(property)
  154. if property == "Throttle" then
  155. alignposition23.AngularVelocity = Seat.Throttle * maxSpeed
  156. alignposition3.AngularVelocity = Seat.Throttle * -maxSpeed
  157. elseif property == "Steer" then
  158. alignposition.TargetAngle = angleSteer * Seat.Steer
  159. alignposition2.TargetAngle = angleSteer * Seat.Steer
  160. end
  161. end
  162. Seat.Changed:Connect(carMove)
  163. local density = 1
  164. local friction = 1
  165. local elasticity = 0
  166. local frictionWeight = 100000000000
  167. local elasticityWeight = 0
  168. local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
  169. Seat.CustomPhysicalProperties = physProperties
  170. wheel.CustomPhysicalProperties = physProperties
  171. wheel2.CustomPhysicalProperties = physProperties
  172. wheel3.CustomPhysicalProperties = physProperties
  173. wheel4.CustomPhysicalProperties = physProperties
  174. wait(0.25)
  175. Seat.Anchored = false
  176.  
  177. function killfunction(part)
  178. pcall(function()
  179. if Seat.Throttle == 1 or Seat.Throttle == -1 then
  180. local Model = part:FindFirstAncestorOfClass("Model")
  181. if Model then
  182. local PC = game:GetService("Players"):GetPlayerFromCharacter(Model)
  183. if PC then
  184. if PC ~= owner then
  185. if PC.Character.Humanoid.Health ~= 0 then
  186. PC.Character.Humanoid.BreakJointsOnDeath = false
  187. PC.Character.Humanoid.Health = 0
  188. BAHAHHAHAHA = Instance.new("Sound", PC.Character.Head)
  189. BAHAHHAHAHA.SoundId = "rbxassetid://6069962045"
  190. BAHAHHAHAHA.Volume = 1
  191. BAHAHHAHAHA:Play()
  192. local limbcollider = Instance.new("Part", PC.Character:findFirstChild("Right Arm"))
  193. limbcollider.Size = Vector3.new(1.4,1,1)
  194. limbcollider.Shape = "Cylinder"
  195. limbcollider.Transparency = 1
  196. limbcollider.Name = "LimbCollider"
  197. local limbcolliderweld = Instance.new("Weld", limbcollider)
  198. limbcolliderweld.Part0 = PC.Character:findFirstChild("Right Arm")
  199. limbcolliderweld.Part1 = limbcollider
  200. limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  201. local limbcollider2 = Instance.new("Part", PC.Character:findFirstChild("Left Arm"))
  202. limbcollider2.Size = Vector3.new(1.4,1,1)
  203. limbcollider2.Shape = "Cylinder"
  204. limbcollider2.Transparency = 1
  205. limbcollider2.Name = "LimbCollider"
  206. local limbcolliderweld2 = Instance.new("Weld", limbcollider)
  207. limbcolliderweld2.Part0 = PC.Character:findFirstChild("Left Arm")
  208. limbcolliderweld2.Part1 = limbcollider2
  209. limbcolliderweld2.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  210. local limbcollider3 = Instance.new("Part", PC.Character:findFirstChild("Right Leg"))
  211. limbcollider3.Size = Vector3.new(1.3,1,1)
  212. limbcollider3.Shape = "Cylinder"
  213. limbcollider3.Transparency = 1
  214. limbcollider3.Name = "LimbCollider"
  215. local limbcolliderweld3 = Instance.new("Weld", limbcollider)
  216. limbcolliderweld3.Part0 = PC.Character:findFirstChild("Right Leg")
  217. limbcolliderweld3.Part1 = limbcollider3
  218. limbcolliderweld3.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  219. local limbcollider4 = Instance.new("Part", PC.Character:findFirstChild("Left Leg"))
  220. limbcollider4.Size = Vector3.new(1.3,1,1)
  221. limbcollider4.Shape = "Cylinder"
  222. limbcollider4.Transparency = 1
  223. limbcollider4.Name = "LimbCollider"
  224. local limbcolliderweld4 = Instance.new("Weld", limbcollider)
  225. limbcolliderweld4.Part0 = PC.Character:findFirstChild("Left Leg")
  226. limbcolliderweld4.Part1 = limbcollider4
  227. limbcolliderweld4.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  228. for i,v in pairs(PC.Character:GetDescendants()) do
  229. if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
  230. local Socket = Instance.new("BallSocketConstraint")
  231. local a1 = Instance.new("Attachment")
  232. local a2 = Instance.new("Attachment")
  233. a1.Parent = v.Part0
  234. a2.Parent = v.Part1
  235. Socket.Parent = v.Parent
  236. Socket.Attachment0 = a1
  237. Socket.Attachment1 = a2
  238. a1.CFrame = v.C0
  239. a2.CFrame = v.C1
  240. Socket.LimitsEnabled = true
  241. Socket.TwistLimitsEnabled = true
  242. v:Destroy()
  243. end
  244. end
  245. end
  246. end
  247. end
  248. end
  249. end
  250. end)
  251. end
  252. Bumper.Touched:Connect(killfunction)
  253. Bumper2.Touched:Connect(killfunction)
  254. Mesh2 = Instance.new("SpecialMesh")
  255. Mesh2.Parent = wheel
  256. Mesh2.MeshId = "http://www.roblox.com/asset/?id=439151274"
  257. Mesh2.TextureId = "http://www.roblox.com/asset/?id=1110514085"
  258. Mesh2.Scale = Vector3.new(0.045,0.045,0.045)
  259. Mesh3 = Instance.new("SpecialMesh")
  260. Mesh3.Parent = wheel2
  261. Mesh3.MeshId = "http://www.roblox.com/asset/?id=439151274"
  262. Mesh3.TextureId = "http://www.roblox.com/asset/?id=1110514085"
  263. Mesh3.Scale = Vector3.new(0.045,0.045,0.045)
  264. Mesh4 = Instance.new("SpecialMesh")
  265. Mesh4.Parent = wheel3
  266. Mesh4.MeshId = "http://www.roblox.com/asset/?id=439151274"
  267. Mesh4.TextureId = "http://www.roblox.com/asset/?id=1110514085"
  268. Mesh4.Scale = Vector3.new(0.045,0.045,0.045)
  269. Mesh5 = Instance.new("SpecialMesh")
  270. Mesh5.Parent = wheel4
  271. Mesh5.MeshId = "http://www.roblox.com/asset/?id=439151274"
  272. Mesh5.TextureId = "http://www.roblox.com/asset/?id=1110514085"
  273. Mesh5.Scale = Vector3.new(0.045, 0.045, 0.045)
Add Comment
Please, Sign In to add comment