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

Need help making a button that can only be pressed by someone with a gamepass?

I am trying to make a button that can only be pressed by a person with a specific gamepass, but everything I try wont work. Can someone help me fix my scripts?

1 answer

You can check if they have the gamepass like this:

local id =          --gamepass id


script.Parent.MouseClick:connect(function(player)
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
    	-- whatever you want to do here
    end
end)


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