What is wrong with my use of Market Place service?

I have an issue on my game, where it will [apparently] randomly not connect to the market place ProcessReceipt function. I don’t get why this happens.

When I connect to it, I make sure no one can prompt a transaction until it has been connected to:
image

and I make it so that it prints as soon as it is called.

image

When someone makes a transaction, when it doesn’t work, it won’t even print that line.

Any ideas? This happened when I was testing i studio too, when I was doing that I noticed it consistently didn’t work if my mouse was outside of the game window while waiting for load. However I wouldn’t expect this to effect game play on client as it is a server script.

Do you only set the ProcessReceipt callback in one script? Use find all to make sure that no other script is also trying to set the callback. I would also recommend adding a print on the line before you set the callback to make sure it is getting set.

2 Likes

Thank you. There was another (old) script (which I forgot about) doing this, I take it setting the ProcessReceipt overrides the previous set rather than calling both? Thanks again for the help!

Yes, this is right. Think of ProcessReceipt like the OnInvoke of a BindableFunction or OnEnvironmentInvoke for a RemoteFunction. You can only have one function assigned to it and defining another one will overwrite the previous one. See ProcessReceipt documentation regarding it.

1 Like