Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seat = script.Parent.VehicleSeat
- local backLeft = script.Parent.BackLeft
- local backRight = script.Parent.BackRight
- local frontLeft = script.Parent.FrontLeft
- local frontRight = script.Parent.FrontRight
- local steerAngle = 30
- local speed = 60
- seat:GetPropertyChangedSignal("Steer"):Connect(function()
- frontLeft.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.Steer
- frontRight.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.Steer
- end)
- seat:GetPropertyChangedSignal("Throttle"):Connect(function()
- frontLeft.Wheel.WheelConstraint.AngularVelocity = speed * seat.Throttle
- frontRight.Wheel.WheelConstraint.AngularVelocity = speed * -seat.Throttle
- backLeft.Wheel.WheelConstraint.AngularVelocity = speed * seat.Throttle
- backRight.Wheel.WheelConstraint.AngularVelocity = speed * -seat.Throttle
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement