#Marketplace Service issue

1 messages · Page 1 of 1 (latest)

past cipher
#

The rewards keep duplicating when spamming the buy button while only paying once. I tried adding rebound, but nothing worked.
Script: https://pastebin.com/raw/1M6d5UtZ

umbral peak
#

it's lowkey hard to read it from there💀 but its cause inside ur you don't actually check if ur UpdateAsync errored or like whether the pcall succeeded or not

#

so even if the updateasync failed ur code still sees granted == true and returns puchase granted and since no purchase History was written it grants another reward

#

so

if setSuc and setErr and granted then
  return PurchaseGranted
else
  return NotProcessedYet
end

might fix it

#

it may also be safer to not have the user spam requests, I would have a like "pending" table of the players pending a request then update the table neccessary. @past cipher

umbral peak
#

tell me if the script worked or smt

past cipher
#

It's my first time monitizating so I'm not good at it

past cipher
umbral peak
#

nah its fine

past cipher
#

@umbral peak Still bugged, I used 10ms autocliker and gave me 3x the reward

umbral peak
#

That's weird lowkey, looking at the documentation, Roblox queues a separate purchase request on their backend which makes sence ofc

#

its possible you could have multiple pending receipts on the backend so they go in with the same Id basically

#

then the queued receipts callback ur stuff simultaneously

past cipher
#

I'll try to remake the code

umbral peak
#

yeah Id just have a pending list of players

#

pretty simple compared to actually understanding the service

past cipher
#

oh wait

#

I tried to debug and

#

oh nvm

past cipher
#

@umbral peak Yoooooo I figured it out

#

So it's not really duplicating

#

It's purchasing multiple times while granting the same reward

#

Also, thanks for trying to help!