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?
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: