How to show “Premium Required” Page When Clicking Something?

Hello! Scythe here! Apologies if this post has been made before, I haven’t really seen one asking the same questions as me, but if you do find one, please link! Anyways, how could I go about doing this:

In the picture, the user clicks on an object, and then it opens up a GUI. Now, I already have that:

local Player = game.Players.LocalPlayer
local Frame = Player.PlayerGui.GUI.Frame
local ClickDetector = workspace.clickbox.ClickDetector

ClickDetector.MouseClick:Connect(function(plr)
if (plr == Player) then
Frame.Visible = not Frame.Visible
end
end)

How could I make a script to do as shown in the picture above? Any help is appreciated, thank you!

1 Like

Not only was it made before, but the homepage on the developer hub leads you right through it. Maybe search on the developer hub too next time.

Premium Payouts

1 Like

Add this to the code, also make sure to check if the player already has premium.
game:GetService("MarketplaceService"):PromptPremiumPurchase(plr)

1 Like

Ah! Sorry about that! I forgot all about using the dev hub and I was just trying to search how to do it on the developer forum, thanks!

1 Like