Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent = owner.Character
- Seat = Instance.new("VehicleSeat")
- Seat.Parent = script
- Seat.Size = Vector3.new(4,1,10)
- Seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,8,-8.057)
- Seat.TopSurface = Enum.SurfaceType.Smooth
- Seat.BottomSurface = Enum.SurfaceType.Smooth
- Bumper = Instance.new("Part")
- Bumper.Parent = script
- Bumper.Size = Vector3.new(7.75,2.25,1)
- Weldlol3 = Instance.new("Weld")
- Weldlol3.Parent = Seat
- Weldlol3.Part0 = Seat
- Weldlol3.Part1 = Bumper
- Weldlol3.C1 = Weldlol3.C1 * CFrame.new(0,-1.25,9.75)
- side = Instance.new("Part")
- side.Parent = script
- side.Size = Vector3.new(1.75,0.25,17.15)
- Weldside = Instance.new("Weld")
- Weldside.Parent = Seat
- Weldside.Part0 = Seat
- Weldside.Part1 = side
- Weldside.C1 = Weldside.C1 * CFrame.new(3.0625,-2.25,0.625)
- side2 = Instance.new("Part")
- side2.Parent = script
- side2.Size = Vector3.new(1.75,0.25,17.15)
- Weldside2 = Instance.new("Weld")
- Weldside2.Parent = Seat
- Weldside2.Part0 = Seat
- Weldside2.Part1 = side2
- Weldside2.C1 = Weldside2.C1 * CFrame.new(-3.0625,-2.25,0.625)
- Bumper3 = Instance.new("Part")
- Bumper3.Parent = script
- Bumper3.Size = Vector3.new(4,2.25,4.65)
- Weldlol32 = Instance.new("Weld")
- Weldlol32.Parent = Bumper
- Weldlol32.Part0 = Bumper
- Weldlol32.Part1 = Bumper3
- Weldlol32.C1 = Weldlol32.C1 * CFrame.new(0,0,-2.5)
- Bumper2 = Instance.new("Part")
- Bumper2.Parent = script
- Bumper2.Size = Vector3.new(7.75,2.25,1)
- Weldlol31 = Instance.new("Weld")
- Weldlol31.Parent = Seat
- Weldlol31.Part0 = Seat
- Weldlol31.Part1 = Bumper2
- Weldlol31.C1 = Weldlol31.C1 * CFrame.new(0,-1.25,-8.5)
- Bumper4 = Instance.new("Part")
- Bumper4.Parent = script
- Bumper4.Size = Vector3.new(4,2.25,4.65)
- Weldlol33 = Instance.new("Weld")
- Weldlol33.Parent = Bumper2
- Weldlol33.Part0 = Bumper2
- Weldlol33.Part1 = Bumper4
- Weldlol33.C1 = Weldlol33.C1 * CFrame.new(0,0,2.5)
- wheel = Instance.new("Part")
- wheel.Parent = Seat
- wheel.Size = Vector3.new(1,3,3)
- steer = Instance.new("Part")
- steer.Parent = Seat
- steer.Size = Vector3.new(1,1,1)
- steer2 = Instance.new("Part")
- steer2.Parent = Seat
- steer2.Size = Vector3.new(1,1,1)
- steer.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25)
- steer2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,1,-7.25)
- steer.Transparency = 1
- steer.CanCollide = false
- steer2.Transparency = 1
- steer2.CanCollide = false
- Seat.Anchored = true
- wheel.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,-7.25)
- wheel.TopSurface = Enum.SurfaceType.Smooth
- wheel.BottomSurface = Enum.SurfaceType.Smooth
- wheel2 = Instance.new("Part")
- wheel2.Parent = Seat
- wheel2.Size = Vector3.new(1,3,3)
- wheel2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25)
- wheel2.TopSurface = Enum.SurfaceType.Smooth
- wheel2.BottomSurface = Enum.SurfaceType.Smooth
- wheel3 = Instance.new("Part")
- wheel3.Parent = Seat
- wheel3.Size = Vector3.new(1,3,3)
- wheel3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,5.75)
- wheel3.TopSurface = Enum.SurfaceType.Smooth
- wheel3.BottomSurface = Enum.SurfaceType.Smooth
- wheel4 = Instance.new("Part")
- wheel4.Parent = Seat
- wheel4.Size = Vector3.new(1,3,3)
- wheel4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,5.75)
- wheel4.TopSurface = Enum.SurfaceType.Smooth
- wheel4.BottomSurface = Enum.SurfaceType.Smooth
- wheel.Shape = Enum.PartType.Cylinder
- wheel2.Shape = Enum.PartType.Cylinder
- wheel3.Shape = Enum.PartType.Cylinder
- wheel4.Shape = Enum.PartType.Cylinder
- local attachment0 = Instance.new("Attachment")
- attachment0.Parent = steer
- local attachment1 = Instance.new("Attachment")
- attachment1.Parent = Seat
- alignposition = Instance.new("HingeConstraint")
- alignposition.Parent = Seat
- alignposition.ActuatorType = "Servo"
- alignposition.TargetAngle = 0
- alignposition.Name = "Hinge4"
- alignposition.ServoMaxTorque = 10000000
- alignposition.AngularSpeed = 10000000
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- attachment1.WorldCFrame = attachment1.Parent.CFrame * CFrame.new(-3.739,1,-7.25) * CFrame.Angles(0,math.rad(180),math.rad(90))
- local attachment02 = Instance.new("Attachment")
- attachment02.Parent = steer2
- local attachment12 = Instance.new("Attachment")
- attachment12.Parent = Seat
- alignposition2 = Instance.new("HingeConstraint")
- alignposition2.Parent = Seat
- alignposition2.ActuatorType = "Servo"
- alignposition2.TargetAngle = 0
- alignposition2.Name = "Hinge3"
- alignposition2.ServoMaxTorque = 10000000
- alignposition2.AngularSpeed = 10000000
- alignposition2.Attachment0 = attachment02
- alignposition2.Attachment1 = attachment12
- attachment12.WorldCFrame = attachment12.Parent.CFrame * CFrame.new(3.739,1,-7.25) * CFrame.Angles(0,0,math.rad(90))
- task.wait()
- local attachment031 = Instance.new("Attachment")
- attachment031.Parent = wheel
- local attachment131 = Instance.new("Attachment")
- attachment131.Parent = steer
- alignposition31 = Instance.new("HingeConstraint")
- alignposition31.Parent = Seat
- alignposition31.ActuatorType = Enum.ActuatorType.None
- alignposition31.Attachment0 = attachment031
- alignposition31.Attachment1 = attachment131
- attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
- local attachment0231 = Instance.new("Attachment")
- attachment0231.Parent = wheel2
- local attachment1231 = Instance.new("Attachment")
- attachment1231.Parent = steer2
- alignposition231 = Instance.new("HingeConstraint")
- alignposition231.Parent = Seat
- alignposition231.ActuatorType = Enum.ActuatorType.None
- alignposition231.Attachment0 = attachment0231
- alignposition231.Attachment1 = attachment1231
- attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
- local attachment03 = Instance.new("Attachment")
- attachment03.Parent = wheel3
- local attachment13 = Instance.new("Attachment")
- attachment13.Parent = Seat
- alignposition3 = Instance.new("HingeConstraint")
- alignposition3.Parent = Seat
- alignposition3.ActuatorType = "Motor"
- alignposition3.MotorMaxAcceleration = 10000000
- alignposition3.MotorMaxTorque = 10000000
- alignposition3.Name = "Hinge1"
- alignposition3.Attachment0 = attachment03
- alignposition3.Attachment1 = attachment13
- attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,0,5.75)* CFrame.Angles(0,math.rad(180),0)
- local attachment023 = Instance.new("Attachment")
- attachment023.Parent = wheel4
- local attachment123 = Instance.new("Attachment")
- attachment123.Parent = Seat
- alignposition23 = Instance.new("HingeConstraint")
- alignposition23.Parent = Seat
- alignposition23.ActuatorType = "Motor"
- alignposition23.MotorMaxAcceleration = 10000000
- alignposition23.MotorMaxTorque = 10000000
- alignposition23.Name = "Hinge2"
- alignposition23.Attachment0 = attachment023
- alignposition23.Attachment1 = attachment123
- attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,0,5.75)
- local motor1 = alignposition3
- local motor2 = alignposition23
- local steerServo = alignposition
- local steerServo2 = alignposition2
- local maxSpeed = 20
- local angleSteer = 27.5
- local density = 1
- local friction = 1
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- Seat.CustomPhysicalProperties = physProperties
- wheel.CustomPhysicalProperties = physProperties
- wheel2.CustomPhysicalProperties = physProperties
- wheel3.CustomPhysicalProperties = physProperties
- wheel4.CustomPhysicalProperties = physProperties
- Part1 = Instance.new("Part")
- Part1.Anchored = true
- Part1.Position = Vector3.new(math.random(-50,50),0,math.random(-50,50))
- wait(0.25)
- Seat.Anchored = false
- local PathfindingService = game:GetService("PathfindingService")
- local destination = Part1
- local maxSpeed = 20
- local angleSteer = 27.5
- local path = PathfindingService:CreatePath()
- path:ComputeAsync(Seat.Position, destination.Position)
- local waypoints = path:GetWaypoints()
- for _, waypoint in pairs(waypoints) do
- bumpp = Bumper.Position
- wayp = waypoint.Position
- local part = Instance.new("Part")
- part.Shape = "Ball"
- part.Material = "Neon"
- part.Size = Vector3.new(0.6, 0.6, 0.6)
- part.Position = waypoint.Position
- part.Anchored = true
- part.CanCollide = false
- part.Parent = script
- alignposition23.AngularVelocity = 1 * maxSpeed
- alignposition3.AngularVelocity = 1 * -maxSpeed
- alignposition.TargetAngle = CFrame.lookAt(bumpp, wayp)
- alignposition2.TargetAngle = CFrame.lookAt(bumpp, wayp)
- wait(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement