This is what i have on a server script. I have an error on line 3
local marketserv = game:GetService("MarketplaceService") marketserv.ProccessReceipt:connect(function(purchaseinfo) local plr1 = game.Players:GetPlayerByUserId(purchaseinfo.PlayerId) local cash = plr1.leaderstats.Cash if purchaseinfo.ProductId == 270172519 then cash.Value = cash.Value + 100 end end)
Don't use :connect (or :Connect) for this, also you didn't set a return value!
local marketserv = game:GetService("MarketplaceService") function marketserv.ProccessReceipt(purchaseinfo) local plr1 = game.Players:GetPlayerByUserId(purchaseinfo.PlayerId) local cash = plr1.leaderstats.Cash if purchaseinfo.ProductId == 270172519 then cash.Value = cash.Value + 100 return Enum.ProductPurchaseDecision.PurchaseGranted --> Any code after this won't run, unless the code doesn't get runned. end end