[Help] DevProduct Script not working

When the DevProduct is purchased by someone there walkspeed gets +5. The only issue is that it does not work. If anyone knows why it’s not working please let me know.

Script:

local MarketplaceService = game:GetService("MarketplaceService")


function processReceipt(receiptInfo)
	local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	-- When DevProduct gets bought, a message will say "User just bought 1204777548" AND will gain +5 Walkspeed
	print(player.Name .. " just bought " .. receiptInfo.ProductId)
	game.Players.LocalPlayer.Character.Humanoid.WalkSpeed += 5
	return Enum.ProductPurchaseDecision.PurchaseGranted
end


MarketplaceService.ProcessReceipt = processReceipt

Screenshot of Output:

Is this client script or server sided?

You have done it in a normal script. You tried to call nil because you can’t find the local plyer in a server script

Its a normal script placed in SSS.

There is your issue! You can’t do .LocalPlayer inside of a normal script, to get the character you can do either player.Character (once you have a player variable) or Players:GetCharacterFromPlayer()