Dev product script works fine in the studio but doesnt work ingame

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A working skip stage and kill all script

  2. What is the issue? Include screenshots / videos if possible!
    the script works good when i test in studio but does not works in the game itself on roblox.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i tried searching solutions up on the web but found nothing. one thing that i saw that might make sense is that the game i owned by a group but the dev products owned by me. i tried fidning a way to make the dev products be owend by the group but i couldnt find a way how to do so

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Players = game:GetService('Players')
local Mps = game:GetService('MarketplaceService')

local SkipStageId = 1684689548
local KillAllId = 1685939264

function ProcessReceipt(ProductInfo)
	local plr = Players:GetPlayerByUserId(ProductInfo.PlayerId)
	if not plr then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	 
	if ProductInfo.ProductId == SkipStageId then
		
		print('skip')
		plr.leaderstats.Stage.Value += 1
		task.wait(0.5)
		plr:LoadCharacter()
		
	elseif ProductInfo.ProductId == KillAllId then
		
		print('killed')
		for _, player in ipairs(game.Players:GetPlayers()) do
			if player ~= plr then
				print('Killed '.. player.Name)
				player.Character:BreakJoints()
			end
		end
		
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

Mps.ProcessReceipt = ProcessReceipt

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.