If the player has both gamepasses doesn't give certain award

Hi, I’m trying to make it so that if the player owns both gamepasses, it gives them a certain prize, however, it will only give one of the prizes from one of the gamepasses. Here is my code:

for i, player in pairs(game.Players:GetPlayers()) do
			if player:FindFirstChild("Piggy") then
			local ownsGoldGamepass = MarketPlace:UserOwnsGamePassAsync(player.UserId, goldGamepassID)
			local ownsTwoXGamepass = MarketPlace:UserOwnsGamePassAsync(player.UserId, twoXCoinGamepassID)
				if ownsTwoXGamepass then
				local coinStore = DataStore2("Coins", player)
				coinStore:Increment(100)
				elseif ownsGoldGamepass then
				local coinStore = DataStore2("Coins", player)
				coinStore:Increment(150)
				elseif ownsGoldGamepass and ownsTwoXGamepass then
				local coinStore = DataStore2("Coins", player)
				coinStore:Increment(250)
				else
				local coinStore = DataStore2("Coins", player)
				coinStore:Increment(50)
				end

			end
		end```

Thank you for the help!

You can switch the order of the way you check if they own the passes, make it so you check if they own both first so that it won’t stop the script from running that if block then check the passes individually.

2 Likes