I am working on a game with the core mechanic based around timing players on various courses and displaying the times on various leaderboards. It is competitive in nature, and as such I have been working on a timer that hits both of these categories as much as possible.
My first (and current approach) is completely server-sided. I have a timer manager script that uses .touched() and os.clock() to count the times of players. At first I thought this was foolproof given the fact that it meant the client could not spoof their times and sent a low time to the server.
What I realized after implementing this in game, though, is that there is some cases such as when users have high ping where they are given unfairly low times due to the fact that the server doesnt register them as having started until after they have already started.
This is an issue as I need these timers to be extremely accurate given the competitive nature of this game. I know I could switch to a local approach which would mean some of these issues would be nonexistent. The issue is that an exploiter could easily spoof times, resulting in an even more ufair experience.
This is where you can come in. I am not an incredibly experienced Lua/Roblox scripter so I am not sure what the best approach is here. I know some sort of combination between server and local scripts with sanity checks would probably be optimal, but I am not sure what the best configuration for this would be. I’d be extremely grateful if you could provide some ideas or help brainstorm solutions with me. Thanks for your time!
-Ethan