How do I cancel a Purchase Prompt automatically

How am I able to hide / cancel a purchaseprompt when it is called, PLS DONATE is able to cancel a prompt. I’ve tried numerous methods, such as using StarterGUI:SetCoreGuiEnabled, but that does not work, and have looked inside the corescripts of roblox.
Here is an example of PLS DONATE cancelling purchaseprompts.

2 Likes

Update, to do this without any local scripts, you can press esc, or the menu to get rid of a prompt, but i am unsure how I can replicate this inside a localscript