Webhook Function and Product Purchase not Responding

I want to make a fully working webhook that notifies me when a product has been purchased (In this case, a skip stage product.) I am also trying to teleport the player to the next checkpoint at the same time in the same script.

The issue is that the webhook AND the skip stage function is not working. I have tried to put the webhook in a different script, but I put a test webhook in there to make sure it works. As what happened in the main script, the same thing happened in this script. NONE of the scripts were working for some reason. If you have any solutions for me, I would be very grateful. (Keep in mind: I am not a good scripter. I’m basically playing in a sandbox with this script.)

UPDATE: I have deleted the webhook I accidentally showed in the previous image. As I said, I am not really new to developing, but I am extremely bad.

1 Like

First thing before anything else, please reupload a screenshot without your webhook exposed.
Someone could send a DELETE request and the webhook will delete itself.

The webhook is not that important to me, but thanks for the tip. I will re-upload a screenshot.

Do you have other scripts also doing ProcessRecipt = function?
Only a single function can be assigned to it so any other scripts doing it will override the existing one.

I have no other scripts using the function. I just ran a test with the print command to see where it messed up, and I saw that the following line is not running at all.

mps.ProcessReceipt = function(receiptInfo, plr)

Can you double check for me?
CTRL + SHIFT + F and search for ProcessReceipt?

There is absolutely nothing else in the game that has ProcessReceipt

Nothing pops up for

mps.ProcessReceipt = function(receiptInfo, plr)
print(receiptInfo, plr)
end

?

I just used “print(2)”, but that print command that you put still didn’t work.
Update: Please do not say anything else, I think I’m getting somewhere

Okay it turns out the printing is working; I just didn’t buy the product. But the script still isn’t functioning.

After I renamed one of the variables, I got an error in the output:

image

I have modified the script and the skip stage function is working now, but the webhook is not.
image

I think you need content value.
on the same scope as ['embeds'] add ['content'] = ""

Should be like:

{
['content'] = ""
['embeds'] = {...}
}
1 Like

Would I need to put anything in the content value? I also do not understand why I have to put in the content value because I have created other fully functional scripts involving webhooks without the content value.

It’s just a guess at the moment.
I’m not very familiar with discord webhooks + httpservice.

It seems I the content value has not changed anything