local MarketplaceService = game:GetService("MarketplaceService") local plrs = game:GetService("Players") local id = 985264450 local function processReceipt(recieptInfo) local plr = plrs:GetPlayerByUserId(recieptInfo.PlayerId) if not plr then return Enum.ProductPurchaseDecision.NotProcessedYet end if plr then game.Players.LocalPlayer.Gems.Value = game.Players.LocalPlayer.Gems.Value + 100 end return Enum.ProductPurchaseDecision.PurchaseGranted end MarketplaceService.ProcessReceipt = processReceipt
Hello.
Problem
You used LocalPlayer
in a ServerScript, which doesn't work because a ServerScript doesn't run on the client. Instead, it runs on a physical server.
Solution
Use the "plr" variable you made instead of LocalPlayer
Fixed Script:
local MarketplaceService = game:GetService("MarketplaceService") local plrs = game:GetService("Players") local id = 985264450 local function processReceipt(recieptInfo) local plr = plrs:GetPlayerByUserId(recieptInfo.PlayerId) if not plr then return Enum.ProductPurchaseDecision.NotProcessedYet end if plr then plr.Gems.Value = plr.Gems.Value + 100 end return Enum.ProductPurchaseDecision.PurchaseGranted end MarketplaceService.ProcessReceipt = processReceipt
Please accept this answer if it helped. There's been a bug for new users that you have to go into incognito mode to accept an answer.