bob is very popular in school now, but he's stuck with an error on studio :o his friends need to help him with his problem
I'm new working with a team in studio, But many of my scripts only work for me not them. I have commited my script. Still not any changes;
Is it perhaps my scripts?
Here is my dev product script;
local RemoteEvent = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("MarketPlaceRemote").RemoteEvent
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local function ProcessReceipt(receiptInfo)
local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not Player then
-- Player left the game
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if Player then
if receiptInfo.ProductId == 1022648288 then
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + 200
workspace.Sounds.Correct:Play()
elseif receiptInfo.ProductId == 1022781767 then
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + 500
workspace.Sounds.Correct:Play()
elseif receiptInfo.ProductId == 1029154409 then
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + 2000
workspace.Sounds.Correct:Play()
elseif receiptInfo.ProductId == 1029155433 then
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + 10000
workspace.Sounds.Correct:Play()
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
RemoteEvent.OnServerEvent:Connect(function(player)
MarketPlaceService.ProcessReceipt = ProcessReceipt
end)

2 comments
you should only return Enum.ProductPurchaseDecision.PurchaseGranted when you saved the purchase at your database/datastore, so that user don't loose robux
what do you mean??