When I advertise my game, I want to make money. So, I want to make a brick that when you click it, it prompts a gamepass. How do I do that?
function onClicked() local player = game.Players.LocalPlayer game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id) -- id is the id of the gamepass end script.Parent.ClickDetector.MouseClick:Connect(onClicked)
Should work, but put the script in the part, and have a ClickDetector in the part aswell. Hope it helps!
script.Parent.ClickDetector.MouseClick:Connect(function(player) game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 00000000) -- id of your gamepass end)