Hey Developers!
I lastly want to make a button, which will prompt player into buying premium for my experience.
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
Rescriptedd
(9gzfaUa1DeGxYkqgZxIJ)
March 8, 2025, 2:17pm
#2
-- // 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
Rescriptedd
(9gzfaUa1DeGxYkqgZxIJ)
March 8, 2025, 2:27pm
#5
you cant click a screengui lol.... just do script.Parent
2 Likes
I’m so stupid god… Thanks for noticing… totally forgot lol
1 Like
Rescriptedd
(9gzfaUa1DeGxYkqgZxIJ)
March 8, 2025, 2:28pm
#7
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
system
(system)
Closed
March 22, 2025, 2:30pm
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.