TheUnknownDiscord

mech?

Oct 25th, 2021 (edited)
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. script.Parent = owner.Character
  2. Seat = Instance.new("VehicleSeat")
  3. Seat.Parent = script
  4. Seat.Size = Vector3.new(4,1,10)
  5. Seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,15,-8.057)
  6. Seat.TopSurface = Enum.SurfaceType.Smooth
  7. Seat.BottomSurface = Enum.SurfaceType.Smooth
  8. wheel = Instance.new("Part")
  9. wheel.Parent = Seat
  10. wheel.Size = Vector3.new(1,5,3)
  11. Seat.Anchored = true
  12. wheel.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,-7.25)
  13. wheel.TopSurface = Enum.SurfaceType.Smooth
  14. wheel.BottomSurface = Enum.SurfaceType.Smooth
  15. wheel2 = Instance.new("Part")
  16. wheel2.Parent = Seat
  17. wheel2.Size = Vector3.new(1,5,3)
  18. wheel2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25)
  19. wheel2.TopSurface = Enum.SurfaceType.Smooth
  20. wheel2.BottomSurface = Enum.SurfaceType.Smooth
  21. local attachment03 = Instance.new("Attachment")
  22. attachment03.Parent = wheel
  23. local attachment13 = Instance.new("Attachment")
  24. attachment13.Parent = Seat
  25. alignposition3 = Instance.new("HingeConstraint")
  26. alignposition3.Parent = Seat
  27. alignposition3.ActuatorType = "Motor"
  28. alignposition3.MotorMaxAcceleration = 10000000
  29. alignposition3.MotorMaxTorque = 1000000000
  30. alignposition3.Name = "Hinge1"
  31. alignposition3.Attachment0 = attachment03
  32. alignposition3.Attachment1 = attachment13
  33. attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,-5,0)* CFrame.Angles(0,0,0)
  34. attachment03.WorldCFrame = attachment03.Parent.CFrame * CFrame.new(3.739,0,0)* CFrame.Angles(0,0,0)
  35. local attachment023 = Instance.new("Attachment")
  36. attachment023.Parent = wheel2
  37. local attachment123 = Instance.new("Attachment")
  38. attachment123.Parent = Seat
  39. alignposition23 = Instance.new("HingeConstraint")
  40. alignposition23.Parent = Seat
  41. alignposition23.ActuatorType = "Motor"
  42. alignposition23.MotorMaxAcceleration = 10000000
  43. alignposition23.MotorMaxTorque = 1000000000
  44. alignposition23.Name = "Hinge2"
  45. alignposition23.Attachment0 = attachment023
  46. alignposition23.Attachment1 = attachment123
  47. attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,-5,0)
  48. attachment023.WorldCFrame = attachment023.Parent.CFrame * CFrame.new(-3.739,0,0)
  49. wheel3 = Instance.new("Part")
  50. wheel3.Parent = Seat
  51. wheel3.Size = Vector3.new(1,5,3)
  52. wheel3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,-7.25)
  53. wheel3.TopSurface = Enum.SurfaceType.Smooth
  54. wheel3.BottomSurface = Enum.SurfaceType.Smooth
  55. wheel4 = Instance.new("Part")
  56. wheel4.Parent = Seat
  57. wheel4.Size = Vector3.new(1,5,3)
  58. wheel4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25)
  59. wheel4.TopSurface = Enum.SurfaceType.Smooth
  60. wheel4.BottomSurface = Enum.SurfaceType.Smooth
  61. local attachment031 = Instance.new("Attachment")
  62. attachment031.Parent = wheel3
  63. local attachment131 = Instance.new("Attachment")
  64. attachment131.Parent = wheel
  65. alignposition31 = Instance.new("HingeConstraint")
  66. alignposition31.Parent = Seat
  67. alignposition31.ActuatorType = "Motor"
  68. alignposition31.MotorMaxAcceleration = 10000000
  69. alignposition31.MotorMaxTorque = 1000000000
  70. alignposition31.Attachment0 = attachment031
  71. alignposition31.Attachment1 = attachment131
  72. attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(0,-8,0)* CFrame.Angles(0,0,0)
  73. attachment031.WorldCFrame = attachment031.Parent.CFrame * CFrame.new(0,4,0)* CFrame.Angles(0,0,0)
  74. local attachment0231 = Instance.new("Attachment")
  75. attachment0231.Parent = wheel4
  76. local attachment1231 = Instance.new("Attachment")
  77. attachment1231.Parent = wheel2
  78. alignposition231 = Instance.new("HingeConstraint")
  79. alignposition231.Parent = Seat
  80. alignposition231.ActuatorType = "Motor"
  81. alignposition231.MotorMaxAcceleration = 10000000
  82. alignposition231.MotorMaxTorque = 1000000000
  83. alignposition231.Attachment0 = attachment0231
  84. alignposition231.Attachment1 = attachment1231
  85. attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(0,-8,0)
  86. attachment0231.WorldCFrame = attachment0231.Parent.CFrame * CFrame.new(0,4,0)
  87. local function carMove(property)
  88. if property == "Throttle" then
  89. if Seat.Throttle == 1 then
  90. alignposition23.AngularVelocity = 1.75
  91. alignposition3.AngularVelocity = -1.25
  92. alignposition231.AngularVelocity = -1.25
  93. alignposition31.AngularVelocity = 1.25
  94. elseif Seat.Throttle == -1 then
  95. alignposition23.AngularVelocity = -1.25
  96. alignposition3.AngularVelocity = 1.75
  97. alignposition231.AngularVelocity = 1.25
  98. alignposition31.AngularVelocity = -1.25
  99. elseif Seat.Throttle == 0 then
  100. alignposition23.AngularVelocity = 0
  101. alignposition3.AngularVelocity = 0
  102. alignposition231.AngularVelocity = 0
  103. alignposition31.AngularVelocity = 0
  104. end
  105. end
  106. end
  107. Seat.Changed:Connect(carMove)
  108. local hatweld = Instance.new("NoCollisionConstraint", wheel)
  109. hatweld.Part0 = wheel
  110. hatweld.Part1 = wheel3
  111. local hatweld2 = Instance.new("NoCollisionConstraint", wheel2)
  112. hatweld2.Part0 = wheel2
  113. hatweld2.Part1 = wheel4
  114. wait(0.5)
  115. local xzGyro = Instance.new("BodyGyro")
  116. xzGyro.MaxTorque = Vector3.new(10000000000,0,10000000000)
  117. xzGyro.P = 1000000000
  118. xzGyro.D = 100000
  119. xzGyro.Parent = Seat
  120. Seat.Anchored = false
RAW Paste Data