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!