Build a Finish Flow for a Roblox Race
Connect a timed gate sequence, a lobby scoreboard and a short finish celebration.
Give the course a predictable opening
Number the gates in the order players encounter them. Trigger the opening sequence from one server prompt and lock it while the run is active. Store each gate's visual and collision settings so it can return to its original state. Leave room near closing gates and test the route at ordinary walk speed.
Update rankings from authoritative scores
Add a readable TextLabel on the lobby scoreboard. Rank connected players by the numeric Score attribute and use a deterministic tie breaker. Set scores from the server's own finish logic. Changing the display every couple of seconds is enough for a lobby.
Add a short finish cue
Attach particle emitters at the finish line and keep their continuous emission off. Emit a burst when a valid character crosses and use a short cooldown to prevent repeated limb contacts firing effects back to back. Try a close finish with several clients.
Lay out a complete race loop on one small map
Make a lobby scoreboard, a set of three practice gates and a finish line that players can reach without needing other mechanics. Use different colors on the gates so you can see exactly which one opened first. Keep the finish marker prominent from the final stretch. Put any spawn point out of the collision path of a closing gate. Walk from the start to the finish at normal speed and time the journey before you choose a gate window. For a first course, give players more time than this baseline. The goal at this stage is to verify the start, route, result and celebration in one complete loop.
Use a single controller for the gate sequence
Put numbered parts under TrainingGates. Use names with leading zeros so ordering is easy to inspect. When GateControl is triggered, set the controller busy before waiting and open each gate in the sorted order. Store the original collision and transparency values for each gate before changing them. After the run window, restore those values. If an object has been removed during the sequence, check it still exists before writing. Leave room for anyone reaching the opening just before it closes. If closing can trap avatars, use a hold-open condition or a safer gate design before reducing the countdown. Test two users trying the control nearly together.
Keep the scoreboard a view of game state
Rank the players using the Score attribute on the server. Make ties deterministic, for example by ordering equal scores by user ID rather than relying on join timing or the order the player service returns. Keep the display script focused on sorting and formatting. The finish handler should decide whether a race counts and then change the score. You can test the board without running the course by assigning one player's test score and observing the result. Add equal scores, then remove a test client. The display should show the remaining players without leaving a stale name. A short update interval is enough for a lobby scoreboard.
table.sort(players, function(a, b)
local scoreA = a:GetAttribute("Score") or 0
local scoreB = b:GetAttribute("Score") or 0
if scoreA == scoreB then return a.UserId < b.UserId end
return scoreA > scoreB
end)
Trigger the celebration only after a sensible event
Put particle emitters at the finish line and disable continuous emission. The linked effect script shows a burst when a living character reaches the marker and limits how often that shared effect can fire. If a match should celebrate only a valid finish, call the effect after the server's timing and progress checks pass. That way walking into the finish backward can be ignored without changing the visual code. Use a modest particle count first and view it on a small screen. A short burst is easier to understand than a long cloud that hides the course. Consider a sound or result banner as a second cue for players who miss the particles.
Observe two racers from start to finish
Start one client first, then let another trigger the controls while the gates are moving. The sequence should remain consistent. Finish close together and verify that each valid player score updates even if the shared particle effect only runs once. Now try skipping a gate or crossing the finish before starting. Confirm which results the timer rejects and which visual effects still appear. Let one client leave after setting a score and see that the lobby board updates. Repeat the race with a slower tester. If the gate closes before a normal attempt can finish, adjust the course timing before changing the scoreboard or adding bonuses for faster play.