Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Dev Products why is this happening??

Soo i am making a tycoon but in the product devloper's tab i wrote all down but when i click on it ingame it has it own price not the price i choosed why is this happening

game.StarterGui.ResetPlayerGuiOnSpawn = false

local MarketplaceService = game:GetService("MarketplaceService")

function getPlayerFromId(id)
	for i,v in pairs(game.Players:GetChildren()) do
		if v.userId == id then
			return v
		end
	end
	return nil
end

function getPlayerFromId(id)
	for i,v in pairs(game.Players:GetPlayers()) do
		if v.userId == id then
			return v
		end
	end
end

 
MarketplaceService.ProcessReceipt = function(receiptInfo)
	local productId = receiptInfo.ProductId
	local playerId = receiptInfo.PlayerId
	local player = getPlayerFromId(playerId)
	local productName 
	if productId == 35958677 then
		productName = "$2,000"
		local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 2000
		end
	elseif receiptInfo.ProductId == 30536330 then -- radio
		game.ServerStorage.ChangeRadio:Invoke(player)
	elseif productId == 35958697 then
		productName = "$10,000!"
		local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 10000
		end
	elseif productId == 22283325 then
		productName = "Day One $1,000!"
		local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
		game.ReplicatedStorage.MasterKey:FireClient(player,"PurchaseConfirm")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 1000
		end 
	elseif productId == 35958724 then
		productName = "+5 Walkspeed"
		local char = player.Character
		if char then
			local human = char:FindFirstChild("Humanoid")
			if human then
				human.WalkSpeed = human.WalkSpeed + 5
			end
		end
	elseif productId == 35958743 then
		productName = "Gravity Coil"
		game.Lighting.GravityCoil:Clone().Parent=player.Backpack
	end
	game.BadgeService:AwardBadge(playerId,202303025)
	if productName ~= nil then
		local message = Instance.new("Hint",workspace)
		message.Text = player.Name.." purchased "..productName.."!"
		spawn(function()
			wait(2)
			message:destroy()
		end)
	end

	return Enum.ProductPurchaseDecision.PurchaseGranted		
end

2 answers

Could you please include some code for us to work with.

This discussion is preserved as it was. New answers, comments, and votes are closed.