How do I check if a user has a game pass when a proximity prompt is fired, and if they don’t have it, prompt them to buy it?
✓ ANSWER ACCEPTED
How do I do the thing below?
1 answer
✓ Accepted answer
For future reference, try and attempt it yourself before asking for help.
local Prompt = script.Parent
local MPS = game:GetService('MarketplaceService')
local gamepassID = 0 -- change to your gamepass
Prompt.Triggered:Connect(function(Player)
if MPS:UserOwnsGamepassAsync(Player.UserId, gamepassID)
-- do stuff
else
MPS:PromptGamePassPurchase(Player, gamepassID)
end -- gamepass own check
end) -- onTriggered
Sources:
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks so much!