Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)


Ad

Answer this question