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

Change in price for Skip Stage gui dev product?

Hello. I'm currently trying to achieve a script that changes price depending on the stage someone is currently on. For example, is someone is on stage 1 and they click the skip stage gui, it goes to a dev product that costs 10 robux. However, if the user is on stage 5, it goes to a different dev product for 25.

My script:

MarketplaceService = Game:GetService("MarketplaceService")

MarketplaceService.ProcessReceipt = function(receiptInfo)
players = game.Players:GetPlayers()

currency = "Stage"

done = 0

for i=1,#players do
	if players[i].userId == receiptInfo.PlayerId then
		if receiptInfo.ProductId == 22277159 and done == 0 then
			done = 1
			players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1
			players[i].Character.Humanoid.Health = 0
			done = 0
		end
	end
end
return Enum.ProductPurchaseDecision.PurchaseGranted	
end

1 answer

Just add an if statement to check what their stage is like

if players[i].leaderstats[currency].Value = 5 then
	--put whatever dev product thing here
end

2 comments

0

You made a small syntax error

0

What would that be? i just copied how his current if statement was structured

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