I've been trying to find an answer to this all day. I'm trying to find if the Player has purchased in either Robux or Tix, using the new developer products feature.
if receiptInfo.CurrencyType == Enum.CurrencyType.Robux then
This line wont work, I have no idea why. Help appreciated im growing very tired of this one line.
EDIT Heres the full code if you see no problem with the line.
local MarketplaceService = Game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") MarketplaceService.ProcessReceipt = function(receiptInfo) hi = Instance.new("Hint") hi.Parent = game.Workspace hi.Text = receiptInfo.PlayerId .. " has donated with "..receiptInfo.CurrencyType.."" wait(2) hi:destroy() if receiptInfo.CurrencyType == Enum.CurrencyType.Robux then script.Parent.Parent.Pos1.Transparency = 1 script.Parent.Parent.Tix.Value = script.Parent.Parent.Tix.Value + 1 elseif receiptInfo.CurrencyType == Enum.CurrencyType.Tix then script.Parent.Parent.Pos2.Transparency = 1 script.Parent.Parent.Robux.Value = script.Parent.Parent.Robux.Value + 1 else script.Parent.Parent.Main.Transparency = 0.5 end return Enum.ProductPurchaseDecision.PurchaseGranted end
Well, the best wiki page I can find about this would be this. My knowledge on Enum's are very limited, but according to the code, it reads in numbers.
And after more research, I found that the Enum's are put into numbers. Don't know if it helps you or not, but perhaps try something like;
if receiptInfo.CurrencyType == Enum.CurrencyType.2 then
Or maybe perhaps;
if receiptInfo.CurrencyType == 2 then
This is all based on my readings of;
If, for example, the user account ROBLOX were to buy a developer product with an ID of 1234, with Robux, the TextLabel would change to be equal to "1 just bought 1234 with 2"