How to check if user *doesn't* have gamepass?

Hey, really simple one here. I want to know how to edit this line of code so that it returns true when the player does NOT have the gamepass. (I am trying to make a “free powerups” gamepass, so I need to only run the payment function when the user does not have the gamepass.)

 if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then

Thanks!

1 Like

Add not?

if not MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then
--code
end

Thanks man. I would have put the “not” in 5 trillion incorrect spots before finding the right place for it lol.

3 Likes