Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My developer product handler is giving me a wearde error?

Wearde... So at first, I got an error I believe I fixed it. Please help me fix this script:
Also the error its giveing me is: ServerScriptService.BuyCash.1:26: unexpected symbol near '?'

-- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local productId = 236341078



-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo) 

 -- find the player based on the PlayerId in receiptInfo
 for i, player in ipairs(game.Players:GetChildren()) do
  if player.userId == receiptInfo.PlayerId then
   
   
   -- check which product was purchased
   if receiptInfo.ProductId == productId then
    
    
   -- give them the cash
   player.leaderstats.Money.Value = player.leaderstats.Money.Value + 250   
   end
  end
 end 
 -- tell ROBLOX that we have successfully handled the transaction
 return Enum.ProductPurchaseDecision.PurchaseGranted  
end)

Also if you're going to fix it do not give me a link to the Roblox wiki or something please give me the script or tell me why this is happening and help me fix it..

2 comments

0

Were not going to give you the answer, this website is mainly for helping people, not just being given a script*

0

This website is not to give scripts it's to help people fix them. Part of that is giveing them the script that fixed that error or whatever..

1 answer

✓ Accepted answer
  1. That's not your script
  2. Please spell better

I found what's causing the problem. On line 8 it says (in your code)

MarketplaceService.ProcessReceipt = function(receiptInfo)

The equal symbol ("=") never is in the start of a function. Fix that line to this:

MarketplaceService.ProcessReceipt:connect(function(receiptInfo)

Read the link below about functions: (I know you sad no Wiki links but it's gonna help you)

Wiki Article About Functions

~Chez_Guy, Dev.

This discussion is preserved as it was. New answers, comments, and votes are closed.