Run it
Copy the script and paste it into your executor.
Players = :()
UserInputService = :()
RunService = :()
Player = Players.LocalPlayer
Character = Player.Character Player.CharacterAdded:()
Humanoid = Character:()
toggleKey = .KeyCode.P
moveSpeed =
tolerance =
autoDriveEnabled =
currentVehicle =
checkpoints = {}
finishLine =
hasReachedFinishLine =
(part)
part part ~=
part:()
part
part = part.Parent
()
racesFolder = :()
racesFolder
{}
checkpointVisuals = {}
_, child (racesFolder:())
child.Name == child:()
.(checkpointVisuals, child)
child.Name == child:()
finishLine = child
.(checkpointVisuals, (a, b)
a.Name < b.Name
)
checkpointVisuals
(vehicle)
vehicle vehicle.PrimaryPart
vehicle.PrimaryPart.AssemblyLinearVelocity = .zero
(vehicle, targetLocation)
primaryPart = vehicle.PrimaryPart
primaryPart
direction = (targetLocation - primaryPart.Position).Unit
primaryPart.AssemblyLinearVelocity = direction * moveSpeed
primaryPart.CFrame = .(primaryPart.Position, primaryPart.Position + direction)
()
autoDriveEnabled = autoDriveEnabled
autoDriveEnabled
SeatPart = Humanoid.SeatPart
SeatPart SeatPart:()
currentVehicle = (SeatPart)
currentVehicle currentVehicle:()
checkpoints = ()
hasReachedFinishLine =
currentVehicle =
.(()
autoDriveEnabled
currentVehicle currentVehicle.PrimaryPart
#checkpoints >
currentCheckpoint = checkpoints[]
currentCheckpoint currentCheckpoint.Parent
targetLocation = currentCheckpoint.Position
distanceToTarget = (currentVehicle.PrimaryPart.Position - targetLocation).Magnitude
(currentVehicle, targetLocation)
distanceToTarget <= tolerance
.(checkpoints, )
nextCheckpointFound =
nextCheckpointFound
()
checkpoints = ()
#checkpoints >
nextCheckpointFound =
(currentVehicle)
.(checkpoints, )
finishLine hasReachedFinishLine
targetLocation = finishLine.Position
distanceToFinish = (currentVehicle.PrimaryPart.Position - targetLocation).Magnitude
(currentVehicle, targetLocation)
distanceToFinish <= tolerance
hasReachedFinishLine =
finishLine =
()
()
(currentVehicle)
()
checkpoints = ()
()
checkpoints = ()
RunService.Heartbeat:()
)()
UserInputService.InputBegan:((input, gameProcessed)
gameProcessed
input.KeyCode == toggleKey
()
)when in line to race execute and "P" is to enable and disable. will need to start race manually every time im to slow to make this work welcome to take it and make it better. thanks Deep Seek for fixing, finish checkpoint and then reorganized the script -_- but still works so meh