Detecting which users touched a part from first to last

Hello! I’m creating something like a racing game- where a UI shows when a user is the first to touch a part, stores that information, and uses it later. The script would also then detect if 3 users have touched it, and end the “match” then. My inspiration is this roblox game: Color Block Run! - Roblox

How can this be done? I have already set up the base frameworks & programmed the Remote Event to work on the round-based system for ending / starting the match appropriately.

Each time a player or their car touches the part, add their name to a table and later get the players using ipairs.

Might not be what you’re looking for so please correct me if so.

When I do that- it duplicates their names 50 times because they keep moving once they touched the part. I also don’t know if this will work with organizing which came first.

For the duplication problem, just check if their name is already in the table (table[name]). About the sorting, I think it should work fine.

1 Like