I'm going to be adding developer products to my game, and there are some instances that can be respawned if someone pays the dev product. (This takes effect on the server as a global purchase.)
Basically what I'm asking about is an edge-case scenario where two people might trigger the proximity prompt, and one person actually pays to respawn the instance, while another person would wait to pay, and then they unnecessarily pay after it's been respawned.
I don't want this to cause issues and have people feel the need to file a complaint agianst me for stealing their robux or something silly like that.
A couple of thoughts I had are:
1. Is there a built-in method to check if the respawn condition has been met already when they press the "Buy" button, and this will cancel the transaction with a custom message, or a generic "purchase failed" prompt?
2. If the respawn condition is met, is there a way to force close the purchase prompt for the client so that they don't make a purchase by mistake?
3. The only real thought I had that I felt could protect me as a developer would be that if there are no such things that could cancel / decline a purchase would be I could just check if it's been respawned, and if it has then deposit a "Credit" into the user's DataStore that would allow for them to respawn the instance for free, since they would have previously purchased something with no benefit / promised good or services.
My idea for what this might look like would be the following: