local mps = game:GetService("MarketplaceService")
mps.PromptPremiumPurchaseFinished:Connect(function(player, isPurchased)
if isPurchased == true then
script.Parent.hasPremium.Value = true
print("successful")
end
end)
Hierarchy
The code above is in a LocalScript and parented to StarterGui
The Value ‘hasPremium’ is a bool value parent to StarterGui
Since I am already a premium member I cannot test this. All I need to know is if mps.PromptPremiumPurchaseFinished:Connect(function(player, isPurchased)
will work.
PromptPremiumPurchuseFinished itself does not return if the premium purchuse was successful. I would look into adding PlayerMembershipChanged to see if the player bought Premium.
FYI This is part of Players and is not part of MPS