How to prompt player to buy Roblox Premium in-experience?

Hey Developers!

I lastly want to make a button, which will prompt player into buying premium for my experience.
Screenshot 2025-03-08 at 9.05.29

I take a look into this article: MarketplaceService | Documentation - Roblox Creator Hub But kinda was not able to understand…

I’m not sure how to exactly script it.

Basically this should be in fact easy, i want it to show that pop-up when the button is pressed.

I would be really happy for any help!

Thanks in advance!
-jeziskrista

2 Likes
-- // Services
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")

-- // Variables
local player = Players.LocalPlayer
local button = script.Parent -- assuming the script is parented to the button

button.MouseButton1Click:Connect(function()
    MarketplaceService:PromptPremiumPurchase(player)
end)
2 Likes

I will try this out asap! I will follow up with an update!

2 Likes

This might look stupid, but I’m doing something wrong i guess…

1 Like

you cant click a screengui lol.... just do script.Parent

2 Likes

I’m so stupid god… Thanks for noticing… totally forgot lol :sweat_smile:

1 Like

also, script.Parent.PremiumGui would be nil, i assume you meant to do script.Parent.Parent

2 Likes

I guess so… Thank you so much for helping me! I made your post as a solution.

2 Likes

you’re welcome :+1:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.