← Back to Racing Scripts

Lap Checkpoint Script

Customize your variables, then fill in the blanks!

Your Custom Settings

RemoteEvent in ReplicatedStorage

LocalScript (StarterGui)

This script detects when the car crosses the finish line. Create a part called "LapCheckpoint" and add a RemoteEvent called "LapEvent" in ReplicatedStorage.

local repStore = game:("ReplicatedStorage")
local lapEvent = repStore:("LapEvent")
local lapCheckpoint = game.:WaitForChild("LapCheckpoint")
lapCheckpoint.:Connect(function(hit)
    if hit. == game.Workspace.myCar then
        lapEvent:()
    end
end)