I was trying to make a VIP room in my game, I've made it but there's a problem. How to make a game pass pop up icon if the player who didn't buy the game pass could buy it in-game? Thanks so much!
✓ ANSWER ACCEPTED
How to make a buy game pass pop up icon after touching the VIP door?
1 answer
✓ Accepted answer
Put a localscript in StarterGui with this code
local mps = game:GetService("MarketplaceService")
local gamepassId = 14837734
local door = game.Workspace.PremDoor
door.Touched:Connect(function(part)
if part.Parent:FindFirstChildWhichIsA("Humanoid") then
local plr = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
local userId = plr.UserId
if mps:UserOwnsGamePassAsync(userId, gamepassId) then
--Run code if player owns the gamepass
else
mps:PromptGamePassPurchase(plr, gamepassId)
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
tysm!
can you explain the script? im having trouble with the marketplace service and the other stuff like the async and the prompt game pass purchase.
Change ur gamepass id and ur door