-- Gamepasses


for i,v in pairs(RS.GamepassIDs:GetChildren()) do
	MS.PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
		if purchased and v.Value == ido then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 5
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
	game.Players.PlayerAdded:Connect(function(plr)
		local Data = plr:WaitForChild("Data", math.huge)
		if MS:UserOwnsGamePassAsync(plr.UserId, v.Value) then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 5
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
end
