How to fix a laggy game (on server) that works perfect in studio?

I’m hoping this is the right section for this topic. I finished my game and it works fantastic. On studio at least. Basically, I have horrible wifi in general, and playing my game caused many problems. I have one section where you find clues, and there is a proximity prompt. When prompted, it destroys the clue (so you can’t select it twice) and adds +1 to the counter I have in the corner. This works well, but in the physical game, the destroy part is sometimes delayed by many seconds, so you are able to prompt the clue multiple times until it eventually destroys (can be from 1 second to around 8, when it should be automatic.) This is just one of the many problems, some being worse and game-breaking.

This is extremely frustrating, as I have no idea how to fix it because if I use another wifi it works a bit better. It makes my game unplayable and I don’t want lag to be the thing that causes people not to play or dislike it. Is there anything I can do on my part? At this point I’m even open to kicking the user if their lag was as bad as mine, because these are the kind of things that easily break the game.

For clarification, this is a single-player game, and all code is linear and follows the player. If one thing is messed up it’s almost impossible to continue.

Any suggestions are open, thank you for any help.

roblox runs in the server and in studio, everything runs in your pc. so it probably is because of your internet

Thank you- I’m aware it’s because of my internet since it’s working fine when I use my data. But I was wondering if there was any possible way to detect this lag? I know roblox disconnects the player from the game if their internet goes down, but I wasn’t sure if there was a way to disconnect them if they are lagging really bad?

you could detect the ping of the player and then run your function when it reaches a certain number