Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I do the thing below?

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?

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:

MarketplaceService

ProximityPrompt

1 comment

0

Thanks so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.