So i did a script for a dev product but i want to make sure the players get extra cash too. Im having trouble getting the player instance. Im not getting any error so how can i fix this and add cash to their stats?
marketPlace = game:GetService("MarketplaceService") productId = 1156445116 playerService = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") Sword = RS:WaitForChild("Sword") local function processRecipt(ReciptInfo) local player = playerService:GetPlayerByUserId(ReciptInfo.PlayerId) if not player then return Enum.ProductPurchaseDecision.NotProcessedYet end if player then local char = game.Workspace:FindFirstChild(player.Name) local swordClone = Sword:Clone() swordClone.Parent = char player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 5555555555 end return Enum.ProductPurchaseDecision.PurchaseGranted end marketPlace.ProcessReceipt = processRecipt
Works fine the script is correct, I had a script that i thought was disabled but wasn't, so it broke this one.